diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index 7900c6b62a4..f627b804989 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -2081,7 +2081,9 @@ async def _async_get_flow_handler( """Get a flow handler for specified domain.""" # First check if there is a handler registered for the domain - if domain in hass.config.components and (handler := HANDLERS.get(domain)): + if loader.is_component_module_loaded(hass, f"{domain}.config_flow") and ( + handler := HANDLERS.get(domain) + ): return handler await _load_integration(hass, domain, hass_config) diff --git a/homeassistant/loader.py b/homeassistant/loader.py index 8906cefb241..9d4d6e880f8 100644 --- a/homeassistant/loader.py +++ b/homeassistant/loader.py @@ -1187,3 +1187,8 @@ def _lookup_path(hass: HomeAssistant) -> list[str]: if hass.config.safe_mode: return [PACKAGE_BUILTIN] return [PACKAGE_CUSTOM_COMPONENTS, PACKAGE_BUILTIN] + + +def is_component_module_loaded(hass: HomeAssistant, module: str) -> bool: + """Test if a component module is loaded.""" + return module in hass.data[DATA_COMPONENTS]