Skip to content

Commit bba62b5

Browse files
committed
Improve docstrings
1 parent de34515 commit bba62b5

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

plugwise/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,13 @@ async def set_temperature_offset(self, dev_id: str, offset: float) -> None:
399399
async def set_switch_state(
400400
self, appl_id: str, members: list[str] | None, model: str, state: str
401401
) -> bool:
402-
"""Set the given State of the relevant Switch."""
402+
"""Set the given State of the relevant Switch.
403+
404+
Return the result:
405+
- True when switched to state on,
406+
- False when switched to state off,
407+
- the unchanged state when the switch is for instance locked.
408+
"""
403409
try:
404410
return await self._smile_api.set_switch_state(
405411
appl_id, members, model, state

plugwise/legacy/smile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ async def _set_groupswitch_member_state(
296296
) -> bool:
297297
"""Helper-function for set_switch_state().
298298
299-
Set the given State of the relevant Switch (relay) within a group of members.
300-
Return the requested state when at least one requested change was succesful, the current state otherwise.
299+
Set the requested state of the relevant switch within a group of switches.
300+
Return the current group-state when none of the switches has changed its state, the requested state otherwise.
301301
"""
302302
current_state = self.gw_entities[appl_id]["switches"]["relay"]
303303
requested_state = state == STATE_ON

plugwise/smile.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,11 @@ def determine_contexts(
380380
async def set_switch_state(
381381
self, appl_id: str, members: list[str] | None, model: str, state: str
382382
) -> bool:
383-
"""Set the given State of the relevant Switch.
383+
"""Set the given state of the relevant Switch.
384384
385+
For individual switches, sets the state directly.
386+
For group switches, sets the state for each member in the group separately.
387+
For switch-locks, sets the lock state using a different data format.
385388
Return the requested state when succesful, the current state otherwise.
386389
"""
387390
model_type = cast(SwitchType, model)
@@ -444,8 +447,8 @@ async def _set_groupswitch_member_state(
444447
) -> bool:
445448
"""Helper-function for set_switch_state().
446449
447-
Set the given State of the relevant Switch within a group of members.
448-
Return the requested state when at least one requested change was succesful, the current state otherwise.
450+
Set the requested state of the relevant switch within a group of switches.
451+
Return the current group-state when none of the switches has changed its state, the requested state otherwise.
449452
"""
450453
current_state = self.gw_entities[appl_id]["switches"]["relay"]
451454
requested_state = state == STATE_ON

0 commit comments

Comments
 (0)