Skip to content

Commit dfb4fd9

Browse files
committed
First remove, then reset
1 parent 9929fa8 commit dfb4fd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugwise_usb/network/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ async def unregister_node(self, node: PlugwiseNode) -> None:
271271
if node.mac not in self._registry:
272272
raise NodeError(f"No existing Node ({node.mac}) found to unregister")
273273

274-
# First reset the node, then remove it from the network.
275-
await node.reset_node()
274+
# First remove the node, when succesful then reset it.
276275
request = NodeRemoveRequest(self._send_to_controller, self._mac_nc, node.mac)
277276
if (response := await request.send()) is None:
278277
raise NodeError(
@@ -285,6 +284,7 @@ async def unregister_node(self, node: PlugwiseNode) -> None:
285284
+ f" failed to unregister node '{node.mac}'"
286285
)
287286

287+
await node.reset_node()
288288
await self.remove_network_registration(node.mac)
289289
await node.clear_cache()
290290

0 commit comments

Comments
 (0)