1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Ensure dependencies are awaited correctly when setting up integrations (#91454)

* Do not wait

* Correct tests

* Manage after dependencies stage 1

* test bootstrap dependencies

* Assert log the dependenciy is waited for

* Improve docstrings

* Assert outside callback

* Patch async_get_integrations

* Revert changes made to snips integration

* Undo changes to mqtt_statestream
This commit is contained in:
Jan Bouwhuis
2023-04-21 08:33:50 +02:00
committed by GitHub
parent 2e18b37291
commit da26b0a930
3 changed files with 139 additions and 3 deletions

View File

@@ -67,7 +67,8 @@ def async_set_domains_to_be_loaded(hass: core.HomeAssistant, domains: set[str])
- Properly handle after_dependencies.
- Keep track of domains which will load but have not yet finished loading
"""
hass.data[DATA_SETUP_DONE] = {domain: asyncio.Event() for domain in domains}
hass.data.setdefault(DATA_SETUP_DONE, {})
hass.data[DATA_SETUP_DONE].update({domain: asyncio.Event() for domain in domains})
def setup_component(hass: core.HomeAssistant, domain: str, config: ConfigType) -> bool: