Skip to content

Commit 4995d35

Browse files
committed
Try
1 parent 410be31 commit 4995d35

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

plugwise_usb/network/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,17 @@ def _unsubscribe_to_protocol_events(self) -> None:
286286

287287
# endregion
288288

289+
async def discover_stick(self, load: bool = False) -> bool:
290+
"""Fetch data from the Stick."""
291+
if self._controller.mac_stick is None:
292+
raise NodeError("Unknown mac address for the Stick.")
293+
294+
_LOGGER.debug("Optain Stick info")
295+
node_info, _ = await self._controller.get_node_details(self._controller.mac_stick, ping_first=False)
296+
if node_info is not None:
297+
self._controller.fw_stick = node_info.firmware
298+
self._controller.hw_stick = node_info.hardware
299+
289300
# region - Coordinator
290301
async def discover_network_coordinator(self, load: bool = False) -> bool:
291302
"""Discover the Zigbee network coordinator (Circle+/Stealth+)."""
@@ -482,6 +493,7 @@ async def start(self) -> None:
482493

483494
async def discover_nodes(self, load: bool = True) -> bool:
484495
"""Discover nodes."""
496+
await self.discover_stick(load=load)
485497
await self.discover_network_coordinator(load=load)
486498
if not self._is_running:
487499
await self.start()

0 commit comments

Comments
 (0)