Skip to content

Commit

Permalink
Support config API key (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouwh authored Aug 1, 2022
1 parent 7f3caa1 commit 4201e4b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion elro/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Elro connects P1 API."""

__version__ = "0.5.1"
__version__ = "0.5.2"
5 changes: 4 additions & 1 deletion elro/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ async def async_disconnect(self) -> None:
finally:
self._lock.release()

async def async_configure(self, ipaddress: str, port: int = 1025) -> None:
async def async_configure(
self, ipaddress: str, port: int = 1025, api_key: str | None = None
) -> None:
"""Process updated settings."""
try:
await self._lock.acquire()
Expand All @@ -166,6 +168,7 @@ async def async_configure(self, ipaddress: str, port: int = 1025) -> None:
self._transport = None
self._protocol = None
self._session = {}
self._api_key = api_key
self._remoteaddress = (ipaddress, port)
self._lock.release()

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = lib-elro-connects
author = Jan Bouwhuis, Bas van den Berg, Johannes Kulick
version = 0.5.1
version = 0.5.2
description = Provides an API to the Elro Connects K1 Connector
long_description = file: README.md, LICENSE
license = MIT License
Expand Down
2 changes: 1 addition & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MOCK_DEVICE_RESPONSE = [
{
"ctrlKey": "deadbeefdeadbeefdeadbeefdeadbeef",
"devTid": "ST_84f3eb1a0021",
"devTid": "ST_deadbeef0000",
"devType": "INDEPENDENT",
"mid": "0123456789ab",
"bindKey": "beefdead012345678beefdead0123456",
Expand Down

0 comments on commit 4201e4b

Please sign in to comment.