mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Fix lingering timer in flux (#92573)
This commit is contained in:
parent
fbd06e0745
commit
2c79adad5e
@ -226,6 +226,12 @@ class FluxSwitch(SwitchEntity, RestoreEntity):
|
||||
if last_state and last_state.state == STATE_ON:
|
||||
await self.async_turn_on()
|
||||
|
||||
async def async_will_remove_from_hass(self) -> None:
|
||||
"""Run when entity will be removed from hass."""
|
||||
if self.unsub_tracker:
|
||||
self.unsub_tracker()
|
||||
return await super().async_will_remove_from_hass()
|
||||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn on flux."""
|
||||
if self.is_on:
|
||||
|
Loading…
x
Reference in New Issue
Block a user