Fix after deps not being considered for integrations before stage 1 (#114045)

This commit is contained in:
J. Nick Koston 2024-03-23 00:21:56 -10:00 committed by GitHub
parent ac80d38871
commit 31fb02a71d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -886,6 +886,14 @@ async def _async_set_up_integrations(
if domain_group:
stage_2_domains -= domain_group
_LOGGER.info("Setting up %s: %s", name, domain_group)
to_be_loaded = domain_group.copy()
to_be_loaded.update(
dep
for domain in domain_group
if (integration := integration_cache.get(domain)) is not None
for dep in integration.all_dependencies
)
async_set_domains_to_be_loaded(hass, to_be_loaded)
await async_setup_multi_components(hass, domain_group, config)
# Enables after dependencies when setting up stage 1 domains

View File

@ -379,6 +379,8 @@ async def test_setup_frontend_before_recorder(hass: HomeAssistant) -> None:
assert "frontend" in hass.config.components
assert "normal_integration" in hass.config.components
assert "recorder" in hass.config.components
assert "http" in hass.config.components
assert order == [
"http",
"frontend",