Deprecate calling async_listen and async_listen_once with run_immediately (#115169)

This commit is contained in:
J. Nick Koston 2024-04-08 10:07:54 -10:00 committed by GitHub
parent 5ef42078a3
commit ca5ed274cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
67 changed files with 126 additions and 243 deletions

View file

@ -189,9 +189,7 @@ class ShellyBlockCoordinator(ShellyCoordinatorBase[BlockDevice]):
self.async_add_listener(self._async_device_updates_handler)
)
entry.async_on_unload(
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, self._handle_ha_stop, run_immediately=True
)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, self._handle_ha_stop)
)
@callback
@ -420,9 +418,7 @@ class ShellyRpcCoordinator(ShellyCoordinatorBase[RpcDevice]):
self._input_event_listeners: list[Callable[[dict[str, Any]], None]] = []
entry.async_on_unload(
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, self._handle_ha_stop, run_immediately=True
)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, self._handle_ha_stop)
)
entry.async_on_unload(entry.add_update_listener(self._async_update_listener))