Skip to content

Commit 02ec48b

Browse files
committed
Merge branch 'mdi_CPRegistry' of github.com:plugwise/python-plugwise-usb into mdi_CPRegistry
2 parents 83fe27e + b0eb709 commit 02ec48b

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

plugwise_usb/network/registry.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def cache_folder(self, cache_folder: str) -> None:
9393

9494
@property
9595
def registry(self) -> list[str]:
96-
"""Return dictionary with all joined nodes."""
96+
"""Return list with mac's of all joined nodes."""
9797
return deepcopy(self._registry)
9898

9999
@property
@@ -252,13 +252,8 @@ async def unregister_node(self, mac: str) -> None:
252252
if not validate_mac(mac):
253253
raise NodeError(f"MAC {mac} invalid")
254254

255-
mac_registered = False
256-
for registration in self._registry.values():
257-
if mac == registration[0]:
258-
mac_registered = True
259-
break
260-
if not mac_registered:
261-
raise NodeError(f"No existing registration '{mac}' found to unregister")
255+
if mac not in self._registry():
256+
raise NodeError(f"No existing Node ({mac}) found to unregister")
262257

263258
request = NodeRemoveRequest(self._send_to_controller, self._mac_nc, mac)
264259
if (response := await request.send()) is None:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "plugwise_usb"
7-
version = "0.44.10a3"
7+
version = "0.44.10a5"
88
license = "MIT"
99
keywords = ["home", "automation", "plugwise", "module", "usb"]
1010
classifiers = [

0 commit comments

Comments
 (0)