Skip to content

Commit 103dca3

Browse files
committed
Fix to async
1 parent 3985032 commit 103dca3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def relay_lock(self) -> bool:
181181
"""State of the relay lock."""
182182
return self._relay_lock
183183

184-
def set_relay_lock(self, state: bool) -> None:
184+
async def set_relay_lock(self, state: bool) -> None:
185185
"""Set the state of the relay-lock."""
186186
self._relay_lock = state
187187
await self.publish_feature_update_to_subscribers(

tests/test_usb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,12 +789,12 @@ async def test_node_relay_and_power(self, monkeypatch: pytest.MonkeyPatch) -> No
789789
assert not stick.nodes["0098765432101234"].relay
790790

791791
# Test blocked async switching due to relay-lock active
792-
stick.nodes["0098765432101234"].set_relay_lock(True)
792+
await stick.nodes["0098765432101234"].set_relay_lock(True)
793793
with pytest.raises(pw_exceptions.NodeError):
794794
await stick.nodes["0098765432101234"].set_relay(True)
795795
assert not stick.nodes["0098765432101234"].relay
796796
# Make sure to turn lock off for further testing
797-
stick.nodes["0098765432101234"].set_relay_lock(False)
797+
await stick.nodes["0098765432101234"].set_relay_lock(False)
798798

799799
# Test async switching back from off to on
800800
self.test_relay_state_on = asyncio.Future()

0 commit comments

Comments
 (0)