Fix lingering timer in flux (#92573)
parent
fbd06e0745
commit
2c79adad5e
|
@ -226,6 +226,12 @@ class FluxSwitch(SwitchEntity, RestoreEntity):
|
||||||
if last_state and last_state.state == STATE_ON:
|
if last_state and last_state.state == STATE_ON:
|
||||||
await self.async_turn_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:
|
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||||
"""Turn on flux."""
|
"""Turn on flux."""
|
||||||
if self.is_on:
|
if self.is_on:
|
||||||
|
|
Loading…
Reference in New Issue