mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Make ConfigEntry.async_shutdown a callback (#111027)
Nothing needed to be awaited here and this generated a task per config entry at shutdown
This commit is contained in:
parent
17ba96ffdb
commit
94e372a345
@ -603,7 +603,8 @@ class ConfigEntry:
|
|||||||
)
|
)
|
||||||
return self._setup_again_job
|
return self._setup_again_job
|
||||||
|
|
||||||
async def async_shutdown(self) -> None:
|
@callback
|
||||||
|
def async_shutdown(self) -> None:
|
||||||
"""Call when Home Assistant is stopping."""
|
"""Call when Home Assistant is stopping."""
|
||||||
self.async_cancel_retry_setup()
|
self.async_cancel_retry_setup()
|
||||||
|
|
||||||
@ -1409,15 +1410,8 @@ class ConfigEntries:
|
|||||||
|
|
||||||
async def _async_shutdown(self, event: Event) -> None:
|
async def _async_shutdown(self, event: Event) -> None:
|
||||||
"""Call when Home Assistant is stopping."""
|
"""Call when Home Assistant is stopping."""
|
||||||
await asyncio.gather(
|
for entry in self._entries.values():
|
||||||
*(
|
entry.async_shutdown()
|
||||||
asyncio.create_task(
|
|
||||||
entry.async_shutdown(),
|
|
||||||
name=f"config entry shutdown {entry.title} {entry.domain} {entry.entry_id}",
|
|
||||||
)
|
|
||||||
for entry in self._entries.values()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
await self.flow.async_shutdown()
|
await self.flow.async_shutdown()
|
||||||
|
|
||||||
async def async_initialize(self) -> None:
|
async def async_initialize(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user