mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Fix lingering timer in generic_hygrostat (#92575)
This commit is contained in:
parent
7e19bb4ee0
commit
7cb25e9710
@ -172,7 +172,11 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if self._keep_alive:
|
if self._keep_alive:
|
||||||
async_track_time_interval(self.hass, self._async_operate, self._keep_alive)
|
self.async_on_remove(
|
||||||
|
async_track_time_interval(
|
||||||
|
self.hass, self._async_operate, self._keep_alive
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
async def _async_startup(event):
|
async def _async_startup(event):
|
||||||
"""Init on startup."""
|
"""Init on startup."""
|
||||||
@ -216,6 +220,12 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
|||||||
|
|
||||||
await _async_startup(None) # init the sensor
|
await _async_startup(None) # init the sensor
|
||||||
|
|
||||||
|
async def async_will_remove_from_hass(self) -> None:
|
||||||
|
"""Run when entity will be removed from hass."""
|
||||||
|
if self._remove_stale_tracking:
|
||||||
|
self._remove_stale_tracking()
|
||||||
|
return await super().async_will_remove_from_hass()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self):
|
def available(self):
|
||||||
"""Return True if entity is available."""
|
"""Return True if entity is available."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user