Fix lingering timer in jewish_calendar (#92470)
This commit is contained in:
parent
a4a795e35b
commit
7dc5d131b4
1 changed files with 7 additions and 0 deletions
|
@ -116,6 +116,13 @@ class JewishCalendarBinarySensor(BinarySensorEntity):
|
|||
await super().async_added_to_hass()
|
||||
self._schedule_update()
|
||||
|
||||
async def async_will_remove_from_hass(self) -> None:
|
||||
"""Run when entity will be removed from hass."""
|
||||
if self._update_unsub:
|
||||
self._update_unsub()
|
||||
self._update_unsub = None
|
||||
return await super().async_will_remove_from_hass()
|
||||
|
||||
@callback
|
||||
def _update(self, now: datetime | None = None) -> None:
|
||||
"""Update the state of the sensor."""
|
||||
|
|
Loading…
Add table
Reference in a new issue