Adjust async_load_platform comment to remove dead lock reference (#114771)

* Adjust async_load_platform comment

Its likely the deadlock here has been fixed for a long time, however
we should still do these in a task because it has to wait for base
components if they are not loaded yet.

* Adjust async_load_platform comment

Its likely the deadlock here has been fixed for a long time, however
we should still do these in a task because it has to wait for base
components if they are not loaded yet.
pull/114777/head
J. Nick Koston 2024-04-03 16:53:31 -10:00 committed by GitHub
parent 3f76d1f056
commit 56d0ad27f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -152,8 +152,11 @@ async def async_load_platform(
Use `async_listen_platform` to register a callback for these events.
Warning: Do not await this inside a setup method to avoid a dead lock.
Use `hass.async_create_task(async_load_platform(..))` instead.
Warning: This method can load a base component if its not loaded which
can take a long time since base components currently have to import
every platform integration listed under it to do config validation.
To avoid waiting for this, use
`hass.async_create_task(async_load_platform(..))` instead.
"""
assert hass_config is not None, "You need to pass in the real hass config"