Skip to content

Commit 6e716e1

Browse files
committed
Block relay without raising an error
1 parent 46a5d43 commit 6e716e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,10 @@ async def set_relay(self, state: bool) -> bool:
641641
)
642642

643643
if self._relay_lock.state:
644-
raise NodeError("Changing state of relay failed, it is locked")
644+
_LOGGER.debug("Relay switch blocked, relay is locked")
645+
return not state
645646

646-
_LOGGER.debug("set_relay() start")
647+
_LOGGER.debug("Switching relay to %s", state)
647648
request = CircleRelaySwitchRequest(self._send, self._mac_in_bytes, state)
648649
response = await request.send()
649650

0 commit comments

Comments
 (0)