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

Avoid calling async_get_component twice for each component being setup (#112096)

We already have the component so we can pass it to
async_process_component_config to avoid having to
look it up again
This commit is contained in:
J. Nick Koston
2024-03-03 07:48:07 -10:00
committed by GitHub
parent 72efb3dab5
commit 9af12a0639
3 changed files with 17 additions and 15 deletions

View File

@@ -1075,11 +1075,11 @@ def assert_setup_component(count, domain=None):
"""
config = {}
async def mock_psc(hass, config_input, integration):
async def mock_psc(hass, config_input, integration, component=None):
"""Mock the prepare_setup_component to capture config."""
domain_input = integration.domain
integration_config_info = await async_process_component_config(
hass, config_input, integration
hass, config_input, integration, component
)
res = integration_config_info.config
config[domain_input] = None if res is None else res.get(domain_input)