Run entity component shutdown immediately (#113635)

pull/113619/head^2
J. Nick Koston 2024-03-16 14:42:36 -10:00 committed by GitHub
parent fa68c5633c
commit 91fa612301
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -120,7 +120,9 @@ class EntityComponent(Generic[_EntityT]):
Note: this is only required if the integration never calls
`setup` or `async_setup`.
"""
self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, self._async_shutdown)
self.hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, self._async_shutdown, run_immediately=True
)
def setup(self, config: ConfigType) -> None:
"""Set up a full entity component.