Skip to content

Commit

Permalink
Merge remote-tracking branch 'pawlizio/master' into dumpfheimer/conne…
Browse files Browse the repository at this point in the history
…ctivity-updates
  • Loading branch information
Christopher Hoch committed Sep 16, 2024
2 parents 4545fd5 + de0de24 commit 795b3ed
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion pyvlx/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyvlx/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion pyvlx/pyvlx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions requirements/production.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pyyaml==6.0.1
zeroconf==0.131.0
pyyaml==6.0.2
zeroconf==0.134.0
19 changes: 9 additions & 10 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
@@ -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
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

PKG_ROOT = os.path.dirname(__file__)

VERSION = "0.1.76"
VERSION = "0.2.23"


def get_long_description() -> str:
Expand Down

0 comments on commit 795b3ed

Please sign in to comment.