Skip to content

Commit c274f1a

Browse files
committed
Fix expected state value
1 parent b7f410a commit c274f1a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

plugwise/legacy/smile.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
OFF,
1919
REQUIRE_APPLIANCES,
2020
RULES,
21-
STATE_ON,
2221
GwEntityData,
2322
ThermoLoc,
2423
)
@@ -242,7 +241,7 @@ async def set_switch_state(
242241
For group switches, sets the state for each member in the group separately.
243242
For switch-locks, sets the lock state using a different data format.
244243
"""
245-
req_state = state == STATE_ON
244+
req_state = state == "true"
246245
switch = Munch()
247246
switch.actuator = "actuator_functionalities"
248247
switch.func_type = "relay_functionality"
@@ -296,7 +295,7 @@ async def _set_groupswitch_member_state(
296295
297296
Set the given State of the relevant Switch (relay) within a group of members.
298297
"""
299-
req_state = state == STATE_ON
298+
req_state = state == "true"
300299
switched = 0
301300
for member in members:
302301
if not self.gw_entities[member]["switches"]["lock"]:

plugwise/smile.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
NOTIFICATIONS,
2323
OFF,
2424
RULES,
25-
STATE_ON,
2625
GwEntityData,
2726
ThermoLoc,
2827
)
@@ -380,7 +379,7 @@ async def set_switch_state(
380379
self, appl_id: str, members: list[str] | None, model: str, state: str
381380
) -> bool:
382381
"""Set the given State of the relevant Switch."""
383-
req_state = state == STATE_ON
382+
req_state = state == "true"
384383
switch = Munch()
385384
switch.actuator = "actuator_functionalities"
386385
switch.device = "relay"
@@ -434,7 +433,7 @@ async def _set_groupswitch_member_state(
434433
435434
Set the given State of the relevant Switch within a group of members.
436435
"""
437-
req_state = state == STATE_ON
436+
req_state = state == "true"
438437
switched = 0
439438
for member in members:
440439
locator = f'appliance[@id="{member}"]/{switch.actuator}/{switch.func_type}'

0 commit comments

Comments
 (0)