diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4efc283..bc40635 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: env: CACHE_VERSION: 1 - DEFAULT_PYTHON: 3.8 + DEFAULT_PYTHON: "3.10" PRE_COMMIT_HOME: ~/.cache/pre-commit jobs: @@ -18,18 +18,18 @@ jobs: # This prevent upcoming jobs to do the same individually prepare-base: name: Prepare base dependencies - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} id: python - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -44,13 +44,14 @@ jobs: - name: Create Python virtual environment if: steps.cache-venv.outputs.cache-hit != 'true' run: | + sudo apt-get update && sudo apt-get install -y libxml2-dev libxslt1-dev python3-dev build-essential python -m venv venv . venv/bin/activate pip install -U "pip<20.3" setuptools pip install -r requirements.txt -r requirements_test.txt - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -65,19 +66,19 @@ jobs: lint-bandit: name: Check bandit - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 id: python with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -92,7 +93,7 @@ jobs: exit 1 - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -109,19 +110,19 @@ jobs: lint-black: name: Check black - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 id: python with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -136,7 +137,7 @@ jobs: exit 1 - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -153,19 +154,19 @@ jobs: lint-codespell: name: Check codespell - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 id: python with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -180,7 +181,7 @@ jobs: exit 1 - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -200,19 +201,19 @@ jobs: lint-executable-shebangs: name: Check executables - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 id: python with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -227,7 +228,7 @@ jobs: exit 1 - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -247,19 +248,19 @@ jobs: lint-flake8: name: Check flake8 - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 id: python with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -274,7 +275,7 @@ jobs: exit 1 - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -294,19 +295,19 @@ jobs: lint-isort: name: Check isort - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 id: python with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -321,7 +322,7 @@ jobs: exit 1 - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -338,19 +339,19 @@ jobs: lint-json: name: Check JSON - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 id: python with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -365,7 +366,7 @@ jobs: exit 1 - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -385,19 +386,19 @@ jobs: lint-pyupgrade: name: Check pyupgrade - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 id: python with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -412,7 +413,7 @@ jobs: exit 1 - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -429,19 +430,19 @@ jobs: lint-yaml: name: Check YAML - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: prepare-base steps: - name: Check out code from GitHub - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Set up Python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v2.2.1 + uses: actions/setup-python@v5 id: python with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Restore base Python virtual environment id: cache-venv - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: venv key: >- @@ -456,7 +457,7 @@ jobs: exit 1 - name: Restore pre-commit environment from cache id: cache-precommit - uses: actions/cache@v2.1.4 + uses: actions/cache@v4 with: path: ${{ env.PRE_COMMIT_HOME }} key: | @@ -475,11 +476,11 @@ jobs: pre-commit run --hook-stage manual yamllint --all-files --show-diff-on-failure pylint: name: Check pylint - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 - name: Set up python ${{ env.DEFAULT_PYTHON }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ env.DEFAULT_PYTHON }} - name: Install dependencies diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e7771da..28e7455 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -8,15 +8,15 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 6c4382b..534aabe 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: actions/setup-python@v5 with: @@ -31,7 +31,7 @@ jobs: # NOTE: put your own distribution build steps here. python -m pip install build python -m build - + - name: Upload wheel to GitHub Release uses: ncipollo/release-action@v1 with: diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml index de2e6ee..14d8a93 100644 --- a/.github/workflows/release_draft.yml +++ b/.github/workflows/release_draft.yml @@ -5,7 +5,7 @@ on: jobs: update_release_draft: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: release-drafter/release-drafter@master env: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cdacb76..dae5a37 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,18 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.34.0 + rev: v3.20.0 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 25.1.0 hooks: - id: black args: - --safe - --quiet - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.4.1 hooks: - id: codespell args: @@ -21,36 +21,38 @@ repos: - --quiet-level=2 exclude_types: [csv, json] - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 7.3.0 hooks: - id: flake8 additional_dependencies: - - flake8-docstrings==1.5.0 - - pydocstyle==5.1.1 + - flake8-docstrings==1.7.0 + - pydocstyle==6.3.0 - repo: https://github.com/PyCQA/bandit - rev: 1.7.4 + rev: 1.8.6 hooks: - id: bandit args: - --quiet - --format=custom - --configfile=tests/bandit.yaml + additional_dependencies: + - pbr - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 6.0.1 hooks: - id: isort args: ["--profile", "black"] - repo: https://github.com/adrienverge/yamllint.git - rev: v1.26.3 + rev: v1.37.1 hooks: - id: yamllint - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + rev: v4.0.0-alpha.8 hooks: - id: prettier stages: [manual] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v6.0.0 hooks: - id: check-executables-have-shebangs stages: [manual] @@ -66,8 +68,7 @@ repos: entry: pylint language: system types: [python] - args: - [ - "-rn", # Only display messages - "-sn", # Don't display the score - ] + args: [ + "-rn", # Only display messages + "-sn", # Don't display the score + ] diff --git a/README.md b/README.md index c75ac69..dc1ced8 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,13 @@ ![CodeQL](https://github.com/Pyhive/Pyhiveapi/workflows/CodeQL/badge.svg) ![Python Linting](https://github.com/Pyhive/Pyhiveapi/workflows/Python%20package/badge.svg) # Introduction -This is a library which intefaces with the Hive smart home platform. +This is a library which interfaces with the Hive smart home platform. This library is built mainly to integrate with the Home Assistant platform, but it can also be used independently (See examples below.) +NOTE: +This integration can only be used with the hive owner account guest accounts are currently not supported. + ## Examples Here are examples and documentation on how to use the library independently. diff --git a/pyhiveapi/apyhiveapi/__init__.py b/pyhiveapi/apyhiveapi/__init__.py index 7436221..7b258a4 100644 --- a/pyhiveapi/apyhiveapi/__init__.py +++ b/pyhiveapi/apyhiveapi/__init__.py @@ -1,4 +1,5 @@ """__init__.py.""" + # pylint: skip-file if __name__ == "pyhiveapi": from .api.hive_api import HiveApi as API # noqa: F401 diff --git a/pyhiveapi/apyhiveapi/action.py b/pyhiveapi/apyhiveapi/action.py index c4af98f..bbd4788 100644 --- a/pyhiveapi/apyhiveapi/action.py +++ b/pyhiveapi/apyhiveapi/action.py @@ -1,4 +1,5 @@ """Hive Action Module.""" + # pylint: skip-file diff --git a/pyhiveapi/apyhiveapi/alarm.py b/pyhiveapi/apyhiveapi/alarm.py index d85fdfb..4e719ce 100644 --- a/pyhiveapi/apyhiveapi/alarm.py +++ b/pyhiveapi/apyhiveapi/alarm.py @@ -1,4 +1,5 @@ """Hive Alarm Module.""" + # pylint: skip-file diff --git a/pyhiveapi/apyhiveapi/api/hive_api.py b/pyhiveapi/apyhiveapi/api/hive_api.py index c81e282..e800cbe 100644 --- a/pyhiveapi/apyhiveapi/api/hive_api.py +++ b/pyhiveapi/apyhiveapi/api/hive_api.py @@ -1,4 +1,5 @@ """Hive API Module.""" + # pylint: skip-file import json diff --git a/pyhiveapi/apyhiveapi/api/hive_async_api.py b/pyhiveapi/apyhiveapi/api/hive_async_api.py index e38e72e..3ced99c 100644 --- a/pyhiveapi/apyhiveapi/api/hive_async_api.py +++ b/pyhiveapi/apyhiveapi/api/hive_async_api.py @@ -1,4 +1,5 @@ """Hive API Module.""" + # pylint: skip-file import json from typing import Optional @@ -58,12 +59,14 @@ async def request( "Accept": "*/*", "Authorization": f"Bearer {self.session.tokens.tokenData['token']}", "x-jwt-token": self.session.tokens.tokenData["token"], + "User-Agent": "Hive/12.04.0 iOS/18.3.1 Apple", } else: headers = { "content-type": "application/json", "Accept": "*/*", - "authorization": self.session.tokens.tokenData["token"], + "Authorization": self.session.tokens.tokenData["token"], + "User-Agent": "Hive/12.04.0 iOS/18.3.1 Apple", } except KeyError: if "sso" in url: @@ -337,7 +340,7 @@ async def setAction(self, n_id, data): return self.json_return async def error(self): - """An error has occurred iteracting with the Hive API.""" + """An error has occurred interacting with the Hive API.""" raise web_exceptions.HTTPError async def isFileBeingUsed(self): diff --git a/pyhiveapi/apyhiveapi/api/hive_auth.py b/pyhiveapi/apyhiveapi/api/hive_auth.py index e4157ba..b27788c 100644 --- a/pyhiveapi/apyhiveapi/api/hive_auth.py +++ b/pyhiveapi/apyhiveapi/api/hive_auth.py @@ -70,7 +70,7 @@ class HiveAuth: SMS_MFA_CHALLENGE = "SMS_MFA" DEVICE_VERIFIER_CHALLENGE = "DEVICE_SRP_AUTH" - def __init__( + def __init__( # pylint: disable=too-many-positional-arguments self, username: str, password: str, @@ -227,7 +227,7 @@ def generate_hash_device(self, device_group_key, device_key): } return device_password, device_secret_verifier_config - def get_device_authentication_key( + def get_device_authentication_key( # pylint: disable=too-many-positional-arguments self, device_group_key, device_key, device_password, server_b_value, salt ): """Get the device authentication key.""" diff --git a/pyhiveapi/apyhiveapi/api/hive_auth_async.py b/pyhiveapi/apyhiveapi/api/hive_auth_async.py index 33df18d..a59c3c4 100644 --- a/pyhiveapi/apyhiveapi/api/hive_auth_async.py +++ b/pyhiveapi/apyhiveapi/api/hive_auth_async.py @@ -21,6 +21,7 @@ HiveInvalidDeviceAuthentication, HiveInvalidPassword, HiveInvalidUsername, + HiveRefreshTokenExpired, ) from .hive_api import HiveApi @@ -57,7 +58,7 @@ class HiveAuthAsync: SMS_MFA_CHALLENGE = "SMS_MFA" DEVICE_VERIFIER_CHALLENGE = "DEVICE_SRP_AUTH" - def __init__( + def __init__( # pylint: disable=too-many-positional-arguments self, username: str, password: str, @@ -218,7 +219,7 @@ async def generate_hash_device(self, device_group_key, device_key): self.device_password = device_password return device_secret_verifier_config - async def get_device_authentication_key( + async def get_device_authentication_key( # pylint: disable=too-many-positional-arguments self, device_group_key, device_key, device_password, server_b_value, salt ): """Get device authentication key.""" @@ -559,6 +560,10 @@ async def refresh_token(self, token): "NotAuthorizedException", "CodeMismatchException", ): + if "Refresh Token has expired" in err.response.get("Error", {}).get( + "Message", "" + ): + raise HiveRefreshTokenExpired from err raise HiveInvalid2FACode from err except botocore.exceptions.EndpointConnectionError as err: if err.__class__.__name__ == "EndpointConnectionError": diff --git a/pyhiveapi/apyhiveapi/camera.py b/pyhiveapi/apyhiveapi/camera.py index 7ccd006..10c26a5 100644 --- a/pyhiveapi/apyhiveapi/camera.py +++ b/pyhiveapi/apyhiveapi/camera.py @@ -1,4 +1,5 @@ """Hive Camera Module.""" + # pylint: skip-file diff --git a/pyhiveapi/apyhiveapi/device_attributes.py b/pyhiveapi/apyhiveapi/device_attributes.py index 7821181..11afe26 100644 --- a/pyhiveapi/apyhiveapi/device_attributes.py +++ b/pyhiveapi/apyhiveapi/device_attributes.py @@ -1,4 +1,5 @@ """Hive Device Attribute Module.""" + # pylint: skip-file from .helper.const import HIVETOHA from .helper.logger import Logger diff --git a/pyhiveapi/apyhiveapi/heating.py b/pyhiveapi/apyhiveapi/heating.py index 95b67c0..c7711f6 100644 --- a/pyhiveapi/apyhiveapi/heating.py +++ b/pyhiveapi/apyhiveapi/heating.py @@ -1,4 +1,5 @@ """Hive Heating Module.""" + # pylint: skip-file from .helper.const import HIVETOHA diff --git a/pyhiveapi/apyhiveapi/helper/__init__.py b/pyhiveapi/apyhiveapi/helper/__init__.py index f86f509..96fdcae 100644 --- a/pyhiveapi/apyhiveapi/helper/__init__.py +++ b/pyhiveapi/apyhiveapi/helper/__init__.py @@ -1,4 +1,5 @@ """__init__.py file.""" + # pylint: skip-file from .hive_helper import HiveHelper # noqa: F401 from .logger import Logger # noqa: F401 diff --git a/pyhiveapi/apyhiveapi/helper/const.py b/pyhiveapi/apyhiveapi/helper/const.py index 42e8fe7..3fa5588 100644 --- a/pyhiveapi/apyhiveapi/helper/const.py +++ b/pyhiveapi/apyhiveapi/helper/const.py @@ -1,4 +1,5 @@ """Constants for Pyhiveapi.""" + # pylint: skip-file SYNC_PACKAGE_NAME = "pyhiveapi" SYNC_PACKAGE_DIR = "/pyhiveapi/" diff --git a/pyhiveapi/apyhiveapi/helper/debugger.py b/pyhiveapi/apyhiveapi/helper/debugger.py index 526d977..f3a3102 100644 --- a/pyhiveapi/apyhiveapi/helper/debugger.py +++ b/pyhiveapi/apyhiveapi/helper/debugger.py @@ -1,4 +1,5 @@ """Debugger file.""" + # pylint: skip-file import logging diff --git a/pyhiveapi/apyhiveapi/helper/hive_exceptions.py b/pyhiveapi/apyhiveapi/helper/hive_exceptions.py index 67bd0ae..e72998b 100644 --- a/pyhiveapi/apyhiveapi/helper/hive_exceptions.py +++ b/pyhiveapi/apyhiveapi/helper/hive_exceptions.py @@ -1,4 +1,5 @@ """Hive exception class.""" + # pylint: skip-file @@ -26,6 +27,14 @@ class HiveApiError(Exception): """ +class HiveRefreshTokenExpired(Exception): + """Refresh token expired. + + Args: + Exception (object): Exception object to invoke + """ + + class HiveReauthRequired(Exception): """Re-Authentication is required. diff --git a/pyhiveapi/apyhiveapi/helper/hive_helper.py b/pyhiveapi/apyhiveapi/helper/hive_helper.py index 7943cd7..051d9d5 100644 --- a/pyhiveapi/apyhiveapi/helper/hive_helper.py +++ b/pyhiveapi/apyhiveapi/helper/hive_helper.py @@ -1,4 +1,5 @@ """Helper class for pyhiveapi.""" + # pylint: skip-file import datetime import operator diff --git a/pyhiveapi/apyhiveapi/helper/hivedataclasses.py b/pyhiveapi/apyhiveapi/helper/hivedataclasses.py index ca9c8fd..184b3cb 100644 --- a/pyhiveapi/apyhiveapi/helper/hivedataclasses.py +++ b/pyhiveapi/apyhiveapi/helper/hivedataclasses.py @@ -1,4 +1,5 @@ """Device data class.""" + # pylint: skip-file from dataclasses import dataclass diff --git a/pyhiveapi/apyhiveapi/helper/logger.py b/pyhiveapi/apyhiveapi/helper/logger.py index db8fe21..b2c4df6 100644 --- a/pyhiveapi/apyhiveapi/helper/logger.py +++ b/pyhiveapi/apyhiveapi/helper/logger.py @@ -1,4 +1,5 @@ """Custom Logging Module.""" + # pylint: skip-file import inspect from datetime import datetime diff --git a/pyhiveapi/apyhiveapi/helper/map.py b/pyhiveapi/apyhiveapi/helper/map.py index afcadd6..b4bd8ea 100644 --- a/pyhiveapi/apyhiveapi/helper/map.py +++ b/pyhiveapi/apyhiveapi/helper/map.py @@ -1,4 +1,5 @@ """Dot notation for dictionary.""" + # pylint: skip-file diff --git a/pyhiveapi/apyhiveapi/hive.py b/pyhiveapi/apyhiveapi/hive.py index eb7c560..dcb258e 100644 --- a/pyhiveapi/apyhiveapi/hive.py +++ b/pyhiveapi/apyhiveapi/hive.py @@ -1,4 +1,5 @@ """Start Hive Session.""" + # pylint: skip-file import sys import traceback diff --git a/pyhiveapi/apyhiveapi/hotwater.py b/pyhiveapi/apyhiveapi/hotwater.py index ae83d82..1466205 100644 --- a/pyhiveapi/apyhiveapi/hotwater.py +++ b/pyhiveapi/apyhiveapi/hotwater.py @@ -1,4 +1,5 @@ """Hive Hotwater Module.""" + # pylint: skip-file from .helper.const import HIVETOHA diff --git a/pyhiveapi/apyhiveapi/hub.py b/pyhiveapi/apyhiveapi/hub.py index ec3bd92..de34fa2 100644 --- a/pyhiveapi/apyhiveapi/hub.py +++ b/pyhiveapi/apyhiveapi/hub.py @@ -1,4 +1,5 @@ """Hive Hub Module.""" + # pylint: skip-file from .helper.const import HIVETOHA diff --git a/pyhiveapi/apyhiveapi/light.py b/pyhiveapi/apyhiveapi/light.py index 703abe7..abab4d7 100644 --- a/pyhiveapi/apyhiveapi/light.py +++ b/pyhiveapi/apyhiveapi/light.py @@ -1,4 +1,5 @@ """Hive Light Module.""" + # pylint: skip-file import colorsys diff --git a/pyhiveapi/apyhiveapi/plug.py b/pyhiveapi/apyhiveapi/plug.py index c86e535..05e4b5e 100644 --- a/pyhiveapi/apyhiveapi/plug.py +++ b/pyhiveapi/apyhiveapi/plug.py @@ -1,4 +1,5 @@ """Hive Switch Module.""" + # pylint: skip-file from .helper.const import HIVETOHA diff --git a/pyhiveapi/apyhiveapi/sensor.py b/pyhiveapi/apyhiveapi/sensor.py index ceb0b99..1fc6c63 100644 --- a/pyhiveapi/apyhiveapi/sensor.py +++ b/pyhiveapi/apyhiveapi/sensor.py @@ -1,4 +1,5 @@ """Hive Sensor Module.""" + # pylint: skip-file from .helper.const import HIVE_TYPES, HIVETOHA, sensor_commands diff --git a/pyhiveapi/apyhiveapi/session.py b/pyhiveapi/apyhiveapi/session.py index 4868a6b..7d37773 100644 --- a/pyhiveapi/apyhiveapi/session.py +++ b/pyhiveapi/apyhiveapi/session.py @@ -1,4 +1,5 @@ """Hive Session Module.""" + # pylint: skip-file import asyncio import copy @@ -475,7 +476,7 @@ async def startSession(self, config: dict = {}): config (dict, optional): Configuration for Home Assistant to use. Defaults to {}. Raises: - HiveUnknownConfiguration: Unknown configuration identifed. + HiveUnknownConfiguration: Unknown configuration identified. HiveReauthRequired: Tokens have expired and reauthentication is required. Returns: diff --git a/requirements.txt b/requirements.txt index ea49687..f1a5a75 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,4 @@ botocore>=1.19.10 requests aiohttp pyquery -unasync -loguru \ No newline at end of file +loguru diff --git a/requirements_test.txt b/requirements_test.txt index b654c22..e3ff3ab 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1 +1,4 @@ -tox \ No newline at end of file +tox +pylint +pytest +pbr \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 325cf5f..b91542a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,7 +22,7 @@ classifiers = package_dir = = pyhiveapi packages = find: -python_requires = >=3.6 +python_requires = >=3.10 [options.packages.find] where = pyhiveapi @@ -57,7 +57,7 @@ ignore = [mypy] -python_version = 3.8 +python_version = 3.10 show_error_codes = true ignore_errors = true follow_imports = silent diff --git a/setup.py b/setup.py index b5c635c..33e9b21 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """Setup pyhiveapi package.""" + # pylint: skip-file import os import re @@ -16,7 +17,7 @@ def requirements_from_file(filename="requirements.txt"): setup( - version="1.0.1", + version="1.0.3", package_data={"data": ["*.json"]}, include_package_data=True, cmdclass={ diff --git a/tests/common.py b/tests/common.py index 95f9d4a..e98ce8a 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,4 +1,5 @@ """Mock services for tests.""" + # pylint: skip-file