Skip to content

Commit 7c2eaf0

Browse files
committed
Register node in node_join_available_message()
1 parent b198e08 commit 7c2eaf0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plugwise_usb/network/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,12 @@ async def node_join_available_message(self, response: PlugwiseResponse) -> bool:
247247
f"Invalid response message type ({response.__class__.__name__}) received, expected NodeJoinAvailableResponse"
248248
)
249249
mac = response.mac_decoded
250-
await self._notify_node_event_subscribers(NodeEvent.JOIN, mac)
251-
return True
250+
if self.register_node(mac):
251+
await self._notify_node_event_subscribers(NodeEvent.JOIN, mac)
252+
return True
253+
254+
_LOGGER.debug("Failed to register available Node with mac=%s", mac)
255+
return False
252256

253257
async def node_rejoin_message(self, response: PlugwiseResponse) -> bool:
254258
"""Handle NodeRejoinResponse messages."""

0 commit comments

Comments
 (0)