Simplify loader preload logic for config_flows (#112290)
We previously checked Integration.config_flow to see if we should pre-import the config flow, but this is now always set for some integration like `homeassistant_green`, `hassio`, etc. Instead we can add it to the rest of the platforms since we already know which files exist. This simplifies the logic and ensures the pre-import still happens if the file is there even if its not listed in the manifest `2024-03-04 22:54:31.906 DEBUG (MainThread) [homeassistant.loader] Importing platforms for homeassistant_green executor=[config_flow] loop=[] took 2.74s`
This commit is contained in:
@@ -1117,7 +1117,7 @@ async def test_async_get_component_preloads_config_and_config_flow(
|
||||
await executor_import_integration.async_get_component()
|
||||
|
||||
assert len(platform_exists_calls[0]) == len(loader.BASE_PRELOAD_PLATFORMS)
|
||||
assert mock_import.call_count == 2 + len(loader.BASE_PRELOAD_PLATFORMS)
|
||||
assert mock_import.call_count == 1 + len(loader.BASE_PRELOAD_PLATFORMS)
|
||||
assert (
|
||||
mock_import.call_args_list[0][0][0]
|
||||
== "homeassistant.components.executor_import"
|
||||
|
||||
Reference in New Issue
Block a user