77from typing import Any
88
99from ..api import StickEvent
10+ from ..constants import UTF8
1011from ..exceptions import NodeError , StickError
11- from ..messages .requests import PlugwiseRequest , StickInitRequest
12+ from ..messages .requests import NodeInfoRequest , PlugwiseRequest , StickInitRequest
1213from ..messages .responses import PlugwiseResponse , StickInitResponse
1314from .manager import StickConnectionManager
1415from .queue import StickQueue
@@ -26,6 +27,8 @@ def __init__(self) -> None:
2627 self ._unsubscribe_stick_event : Callable [[], None ] | None = None
2728 self ._init_sequence_id : bytes | None = None
2829 self ._is_initialized = False
30+ self ._fw_stick : str | None = None
31+ self ._hw_stick : str | None = None
2932 self ._mac_stick : str | None = None
3033 self ._mac_nc : str | None = None
3134 self ._network_id : int | None = None
@@ -43,6 +46,16 @@ def is_connected(self) -> bool:
4346 """Return connection state from connection manager."""
4447 return self ._manager .is_connected
4548
49+ @property
50+ def firmware_stick (self ) -> str | None :
51+ """Firmware version of the Stick."""
52+ return self ._fw_stick
53+
54+ @property
55+ def hardware_stick (self ) -> str | None :
56+ """Hardware version of the Stick."""
57+ return self ._hw_stick
58+
4659 @property
4760 def mac_stick (self ) -> str :
4861 """MAC address of USB-Stick. Raises StickError when not connected."""
@@ -167,6 +180,14 @@ async def initialize_stick(self) -> None:
167180 self ._network_id = init_response .network_id
168181 self ._is_initialized = True
169182
183+ # add Stick NodeInfoRequest
184+ info_request = NodeInfoRequest (
185+ self .send , bytes (self ._mac_stick , UTF8 ), retries = 1
186+ )
187+ info_response = await info_request .send ()
188+ self ._fw_stick = info_response .firmware
189+ self ._hw_stick = info_response .hardware
190+
170191 if not self ._network_online :
171192 raise StickError ("Zigbee network connection to Circle+ is down." )
172193
0 commit comments