mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Ensure that inactive RainMachine switch that is toggled on is toggled back off (#60959)
This commit is contained in:
parent
68ca0a05c8
commit
566716d697
@ -277,6 +277,8 @@ class RainMachineActivitySwitch(RainMachineBaseSwitch):
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn the switch on."""
|
||||
if not self.coordinator.data[self.entity_description.uid]["active"]:
|
||||
self._attr_is_on = False
|
||||
self.async_write_ha_state()
|
||||
raise HomeAssistantError(
|
||||
f"Cannot turn on an inactive program/zone: {self.name}"
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user