Skip to content

Commit eefb304

Browse files
committed
Adapt legacy set_switch_state() output typing
1 parent b17a1fc commit eefb304

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugwise/legacy/smile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,15 @@ async def set_schedule_state(
223223

224224
async def set_switch_state(
225225
self, appl_id: str, members: list[str] | None, model: str, state: str
226-
) -> bool:
226+
) -> bool | None:
227227
"""Set the given state of the relevant switch.
228228
229229
For individual switches, sets the state directly.
230230
For group switches, sets the state for each member in the group separately.
231231
For switch-locks, sets the lock state using a different data format.
232232
Return the requested state when successful, the current state otherwise.
233233
"""
234-
current_state = self.gw_entities[appl_id]["switches"]["relay"]
234+
current_state = self.gw_entities[appl_id]["switches"].get("relay")
235235
requested_state = state == STATE_ON
236236
switch = Munch()
237237
switch.actuator = "actuator_functionalities"

0 commit comments

Comments
 (0)