Skip to content

Commit

Permalink
Fix geniushub smart plug state at start-up (#102110)
Browse files Browse the repository at this point in the history
* Smart plug did state wrong at start-up

* Update docstring to reflect code
  • Loading branch information
GeoffAtHome authored and frenck committed Dec 5, 2023
1 parent ca14706 commit 55bafc2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions homeassistant/components/geniushub/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ def device_class(self):
def is_on(self) -> bool:
"""Return the current state of the on/off zone.
The zone is considered 'on' if & only if it is override/on (e.g. timer/on is 'off').
The zone is considered 'on' if the mode is either 'override' or 'timer'.
"""
return self._zone.data["mode"] == "override" and self._zone.data["setpoint"]
return (
self._zone.data["mode"] in ["override", "timer"]
and self._zone.data["setpoint"]
)

async def async_turn_off(self, **kwargs: Any) -> None:
"""Send the zone to Timer mode.
Expand Down

0 comments on commit 55bafc2

Please sign in to comment.