Skip to content

Commit c0a7ead

Browse files
committed
Try
1 parent 3eace20 commit c0a7ead

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

plugwise/smile.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,13 @@ async def set_switch_state(
425425
switch_id = item.attrib["id"]
426426

427427
uri = f"{APPLIANCES};id={appl_id}/{switch.device};id={switch_id}"
428-
lock_blocked = self.gw_entities[appl_id]["switches"].get("lock")
429-
LOGGER.debug("HOI lock_blocked=%s", lock_blocked)
430-
if model == "relay" and lock_blocked:
428+
if model == "relay":
429+
lock_blocked = self.gw_entities[appl_id]["switches"].get("lock")
430+
LOGGER.debug("HOI lock_blocked=%s", lock_blocked)
431+
if lock_blocked or lock_blocked is None:
431432
# Don't switch a relay when its corresponding lock-state is true or no
432433
# lock is present. That means the relay can't be controlled by the user.
433-
return current_state
434+
return current_state
434435

435436
await self.call_request(uri, method="put", data=data)
436437
return requested_state

0 commit comments

Comments
 (0)