Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust async_load_platform comment to remove dead lock reference #114771

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions homeassistant/helpers/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down