mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add comment to ConfigEntry.async_setup about race safety (#107756)
This commit is contained in:
parent
1bb76e2351
commit
b2f7fd12a2
@ -478,6 +478,12 @@ class ConfigEntry:
|
|||||||
if self.domain != integration.domain:
|
if self.domain != integration.domain:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
#
|
||||||
|
# It is important that this function does not yield to the
|
||||||
|
# event loop by using `await` or `async with` or similar until
|
||||||
|
# after the state has been set. Otherwise we risk that any `call_soon`s
|
||||||
|
# created by an integration will be executed before the state is set.
|
||||||
|
#
|
||||||
if result:
|
if result:
|
||||||
self._async_set_state(hass, ConfigEntryState.LOADED, None)
|
self._async_set_state(hass, ConfigEntryState.LOADED, None)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user