diff --git a/homeassistant/loader.py b/homeassistant/loader.py index f19577ac10a..46f3e352596 100644 --- a/homeassistant/loader.py +++ b/homeassistant/loader.py @@ -742,7 +742,10 @@ class Integration: @cached_property def import_executor(self) -> bool: """Import integration in the executor.""" - return self.manifest.get("import_executor") or False + # If the integration does not explicitly set import_executor, we default to + # True if it's a built-in integration and False if it's a custom integration. + # In the future, we want to default to True for all integrations. + return self.manifest.get("import_executor", self.is_built_in) @property def mqtt(self) -> list[str] | None: diff --git a/tests/test_loader.py b/tests/test_loader.py index fdbc457dfe0..0c0431ed227 100644 --- a/tests/test_loader.py +++ b/tests/test_loader.py @@ -1033,6 +1033,14 @@ async def test_async_suggest_report_issue( ) +def test_import_executor_default(hass: HomeAssistant) -> None: + """Test that import_executor defaults.""" + custom_comp = mock_integration(hass, MockModule("any_random"), built_in=False) + assert custom_comp.import_executor is False + built_in_comp = mock_integration(hass, MockModule("other_random"), built_in=True) + assert built_in_comp.import_executor is True + + async def test_config_folder_not_in_path(hass): """Test that config folder is not in path."""