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