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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user