diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7152852e..9d5c474f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,9 +49,11 @@ jobs: - name: Linter Pylint run: PYTHONPATH=. pylint --rcfile=.pylintrc pyvlx test/*.py *.py examples/*.py - name: Mypy - run: mypy pyvlx + run: mypy --install-types --non-interactive pyvlx - name: Tests run: PYTHONPATH=. pytest --cov pyvlx --cov-report xml + - name: Isort + run: isort --check-only test examples pyvlx - name: Upload coverage artifact uses: actions/upload-artifact@v2.2.2 with: diff --git a/pyvlx/connection.py b/pyvlx/connection.py index 743edb7a..f48df197 100644 --- a/pyvlx/connection.py +++ b/pyvlx/connection.py @@ -159,7 +159,7 @@ def write(self, frame: FrameBase) -> None: @staticmethod def create_ssl_context() -> ssl.SSLContext: """Create and return SSL Context.""" - ssl_context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH) + ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE return ssl_context diff --git a/pyvlx/discovery.py b/pyvlx/discovery.py index e28ca743..b25d7a22 100644 --- a/pyvlx/discovery.py +++ b/pyvlx/discovery.py @@ -23,7 +23,7 @@ class VeluxHost(): class VeluxDiscovery(): """Class to discover Velux KLF200 devices on the network.""" - hosts: list[VeluxHost | None] = [] + hosts: list[VeluxHost] = [] infos: list[AsyncServiceInfo | None] = [] def __init__(self, zeroconf: AsyncZeroconf,) -> None: diff --git a/pyvlx/pyvlx.py b/pyvlx/pyvlx.py index 139af6e1..bb521c57 100644 --- a/pyvlx/pyvlx.py +++ b/pyvlx/pyvlx.py @@ -51,7 +51,7 @@ def __init__( self.protocol_version = None self.klf200 = Klf200Gateway(pyvlx=self) self.api_call_semaphore = asyncio.Semaphore(1) # Limit parallel commands - PYVLXLOG.debug("Loadig pyvlx v0.1.76") + PYVLXLOG.debug("Loadig pyvlx v0.2.23") async def connect(self) -> None: """Connect to KLF 200.""" @@ -107,6 +107,8 @@ async def disconnect(self) -> None: except (OSError, PyVLXException): pass await self.heartbeat.stop() + # Reboot KLF200 when disconnecting to avoid unresponsive KLF200. + await self.klf200.reboot() self.connection.disconnect() async def load_nodes(self, node_id: Optional[int] = None) -> None: diff --git a/requirements/production.txt b/requirements/production.txt index 052f2b6f..1e459094 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -1,2 +1,2 @@ -pyyaml==6.0.1 -zeroconf==0.131.0 \ No newline at end of file +pyyaml==6.0.2 +zeroconf==0.134.0 diff --git a/requirements/testing.txt b/requirements/testing.txt index 65e4cb3d..88c4c554 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -1,14 +1,13 @@ -r production.txt isort==5.13.2 -coveralls==3.3.1 -flake8==7.0.0 +coveralls==4.0.1 +flake8==7.1.1 flake8-isort==6.1.1 pydocstyle==6.3.0 -pylint==3.0.3 -pytest==8.0.0 -pytest-cov==4.0.0 -pytest-timeout==2.2.0 -setuptools==69.1.0 -twine==5.0.0 -mypy==1.8.0 -types-pyyaml==6.0.12.12 \ No newline at end of file +pylint==3.2.7 +pytest==8.3.2 +pytest-cov==5.0.0 +pytest-timeout==2.3.1 +setuptools==74.1.2 +twine==5.1.1 +mypy==1.11.2 diff --git a/setup.py b/setup.py index 5fb13e1f..868d628d 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ PKG_ROOT = os.path.dirname(__file__) -VERSION = "0.1.76" +VERSION = "0.2.23" def get_long_description() -> str: