Skip to content

Commit

Permalink
Remove final write listener on config entry unload (#3606)
Browse files Browse the repository at this point in the history
Co-authored-by: Joakim Sørensen <[email protected]>
  • Loading branch information
emontnemery and ludeeus authored Apr 11, 2024
1 parent 1a1b2eb commit 3be5859
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/hacs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,11 @@ async def startup_tasks(self, _=None) -> None:
)
)

self.hass.bus.async_listen_once(
unsub = self.hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_FINAL_WRITE, self.data.async_force_write
)
if config_entry := self.configuration.config_entry:
config_entry.async_on_unload(unsub)

self.log.debug("There are %s scheduled recurring tasks", len(self.recuring_tasks))

Expand Down

0 comments on commit 3be5859

Please sign in to comment.