Skip to content

Commit 4397479

Browse files
committed
Collect Stick data during initialization
1 parent 1a78559 commit 4397479

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

plugwise_usb/connection/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ async def initialize_stick(self) -> None:
190190
self._network_id = init_response.network_id
191191
self._is_initialized = True
192192

193-
# # add Stick NodeInfoRequest
194-
# node_info, _ = await self.get_node_details(self._mac_stick, False)
195-
# if node_info is not None:
196-
# self._fw_stick = node_info.firmware
197-
# self._hw_stick = node_info.hardware
193+
# Add Stick NodeInfoRequest
194+
node_info, _ = await self.get_node_details(self._mac_stick, ping_first=False)
195+
if node_info is not None:
196+
self._fw_stick = node_info.firmware
197+
self._hw_stick = node_info.hardware
198198

199199
if not self._network_online:
200200
raise StickError("Zigbee network connection to Circle+ is down.")

plugwise_usb/network/__init__.py

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

287287
# endregion
288-
289-
async def discover_stick(self) -> 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("Obtaining 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
299288

300289
# region - Coordinator
301290
async def discover_network_coordinator(self, load: bool = False) -> bool:
@@ -493,7 +482,6 @@ async def start(self) -> None:
493482

494483
async def discover_nodes(self, load: bool = True) -> bool:
495484
"""Discover nodes."""
496-
await self.discover_stick()
497485
await self.discover_network_coordinator(load=load)
498486
if not self._is_running:
499487
await self.start()

0 commit comments

Comments
 (0)