Skip to content

Commit c771745

Browse files
committed
Fix node property, as suggested
1 parent ff6ef38 commit c771745

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

plugwise_usb/nodes/node.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
NodeType,
2424
PowerStatistics,
2525
RelayConfig,
26+
RelayLock,
2627
RelayState,
2728
)
2829
from ..connection import StickController
@@ -277,10 +278,12 @@ def power(self) -> PowerStatistics:
277278

278279
@property
279280
@raise_not_loaded
280-
def relay_state(self) -> RelayState:
281-
"""State of relay."""
282-
if NodeFeature.RELAY not in self._features:
283-
raise FeatureError(f"Relay state is not supported for node {self.mac}")
281+
def relay_config(self) -> RelayConfig:
282+
"""Relay configuration."""
283+
if NodeFeature.RELAY_INIT not in self._features:
284+
raise FeatureError(
285+
f"Relay configuration is not supported for node {self.mac}"
286+
)
284287
raise NotImplementedError()
285288

286289
@property
@@ -293,18 +296,16 @@ def relay(self) -> bool:
293296

294297
@property
295298
@raise_not_loaded
296-
def relay_config(self) -> RelayConfig:
297-
"""Relay configuration."""
298-
if NodeFeature.RELAY_INIT not in self._features:
299-
raise FeatureError(
300-
f"Relay configuration is not supported for node {self.mac}"
301-
)
299+
def relay_state(self) -> RelayState:
300+
"""State of relay."""
301+
if NodeFeature.RELAY not in self._features:
302+
raise FeatureError(f"Relay state is not supported for node {self.mac}")
302303
raise NotImplementedError()
303304

304305
@property
305306
@raise_not_loaded
306-
def relay_lock(self) -> bool:
307-
"""Relay value."""
307+
def relay_lock(self) -> RelayLock:
308+
"""State of relay lock."""
308309
if NodeFeature.RELAY_LOCK not in self._features:
309310
raise FeatureError(f"Relay lock is not supported for node {self.mac}")
310311
raise NotImplementedError()

0 commit comments

Comments
 (0)