Skip to content

Commit b03c510

Browse files
committed
Remove unneeded StickError raises
1 parent 88009d2 commit b03c510

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

plugwise_usb/connection/__init__.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,33 +72,18 @@ def hardware_stick(self) -> str | None:
7272
return self._hw_stick
7373

7474
@property
75-
def mac_stick(self) -> str:
76-
"""MAC address of USB-Stick. Raises StickError when not connected."""
77-
if self._mac_stick is None:
78-
raise StickError(
79-
"No mac_stick address available. Connect and initialize USB-Stick first."
80-
)
75+
def mac_stick(self) -> str ? None:
76+
"""MAC address of USB-Stick."""
8177
return self._mac_stick
8278

8379
@property
84-
def mac_coordinator(self) -> str:
85-
"""Return MAC address of the Zigbee network coordinator (Circle+).
86-
87-
Raises StickError when not connected.
88-
"""
89-
if not self._manager.is_connected or self._mac_nc is None:
90-
raise StickError(
91-
"No mac_nc address available. Connect and initialize USB-Stick first."
92-
)
80+
def mac_coordinator(self) -> str | None:
81+
"""Return MAC address of the Zigbee network coordinator (Circle+)."""
9382
return self._mac_nc
9483

9584
@property
96-
def network_id(self) -> int:
97-
"""Returns the Zigbee network ID. Raises StickError when not connected."""
98-
if not self._manager.is_connected or self._network_id is None:
99-
raise StickError(
100-
"No network ID available. Connect and initialize USB-Stick first."
101-
)
85+
def network_id(self) -> int | None:
86+
"""Returns the Zigbee network ID."""
10287
return self._network_id
10388

10489
@property

0 commit comments

Comments
 (0)