Skip to content

Commit 160a61a

Browse files
committed
Update_node_registration() should not be async
1 parent 986c5a7 commit 160a61a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plugwise_usb/network/registry.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ async def update_missing_registrations(self, quick: bool = False) -> None:
223223
await self._full_scan_finished()
224224
self._full_scan_finished = None
225225

226+
def update_node_registration(self, mac: str) -> int:
227+
"""Register (re)joined node to Plugwise network and return network address."""
228+
self.update_network_registration(self._first_free_address, mac, None)
229+
self._first_free_address += 1
230+
return self._first_free_address - 1
231+
226232
def _stop_registration_task(self) -> None:
227233
"""Stop the background registration task."""
228234
if self._registration_task is None:
@@ -253,12 +259,6 @@ async def register_node(self, mac: str) -> None:
253259
request = NodeAddRequest(self._send_to_controller, bytes(mac, UTF8), True)
254260
await request.send()
255261

256-
async def update_node_registration(self, mac: str) -> int:
257-
"""Register (re)joined node to Plugwise network and return network address."""
258-
self.update_network_registration(self._first_free_address, mac, None)
259-
self._first_free_address += 1
260-
return self._first_free_address - 1
261-
262262
async def unregister_node(self, mac: str) -> None:
263263
"""Unregister node from current Plugwise network."""
264264
if not validate_mac(mac):

0 commit comments

Comments
 (0)