Skip to content

Commit c7e2e35

Browse files
committed
Add Stick-name property
1 parent ab560bb commit c7e2e35

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

plugwise_usb/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ def mac_coordinator(self) -> str:
137137
"""MAC address of the network coordinator (Circle+). Raises StickError is connection is missing."""
138138
return self._controller.mac_coordinator
139139

140+
@property
141+
def name(self) -> str:
142+
"""Return name of Stick."""
143+
return self._controller._stick_name
144+
140145
@property
141146
def network_discovered(self) -> bool:
142147
"""Indicate if discovery of network is active. Raises StickError is connection is missing."""

plugwise_usb/connection/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ async def initialize_stick(self) -> None:
184184
+ f"' {self._manager.serial_path}'"
185185
)
186186
self._mac_stick = init_response.mac_decoded
187+
self._stick_name = f"Stick {self._mac_stick[-5:]}"
187188
self._network_online = init_response.network_online
188189

189190
# Replace first 2 characters by 00 for mac of circle+ node

0 commit comments

Comments
 (0)