Skip to content

Commit e90fa5d

Browse files
committed
Add register_rejoined_node() function
1 parent 98e8445 commit e90fa5d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plugwise_usb/network/registry.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,15 @@ async def register_node(self, mac: str) -> int:
263263
self._first_free_address += 1
264264
return self._first_free_address - 1
265265

266+
async def register_rejoined_node(self, mac: str) -> int:
267+
"""Re-register rejoined node to Plugwise network and return network address."""
268+
if not validate_mac(mac):
269+
raise NodeError(f"MAC '{mac}' invalid")
270+
271+
self.update_network_registration(self._first_free_address, mac, None)
272+
self._first_free_address += 1
273+
return self._first_free_address - 1
274+
266275
async def unregister_node(self, mac: str) -> None:
267276
"""Unregister node from current Plugwise network."""
268277
if not validate_mac(mac):

0 commit comments

Comments
 (0)