diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index 696745ab3867..4c8ca0a00b2a 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -239,6 +239,8 @@ DEFAULT_INTEGRATIONS = { } DEFAULT_INTEGRATIONS_RECOVERY_MODE = { # These integrations are set up if recovery mode is activated. + "backup", + "cloud", "frontend", } DEFAULT_INTEGRATIONS_SUPERVISOR = { diff --git a/homeassistant/components/recovery_mode/manifest.json b/homeassistant/components/recovery_mode/manifest.json index 1e46a4acde64..5837a648ecbf 100644 --- a/homeassistant/components/recovery_mode/manifest.json +++ b/homeassistant/components/recovery_mode/manifest.json @@ -3,7 +3,7 @@ "name": "Recovery Mode", "codeowners": ["@home-assistant/core"], "config_flow": false, - "dependencies": ["frontend", "persistent_notification", "cloud"], + "dependencies": ["persistent_notification"], "documentation": "https://www.home-assistant.io/integrations/recovery_mode", "integration_type": "system", "quality_scale": "internal" diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py index 8e912f198613..2e2f52bf0bbe 100644 --- a/tests/test_bootstrap.py +++ b/tests/test_bootstrap.py @@ -895,6 +895,36 @@ async def test_setup_hass_recovery_mode( assert len(browser_setup.mock_calls) == 0 +@pytest.mark.parametrize("domain", ["cloud", "backup"]) +async def test_setup_hass_recovery_mode_with_failing_integration( + mock_enable_logging: AsyncMock, + mock_is_virtual_env: Mock, + mock_mount_local_lib_path: AsyncMock, + mock_ensure_config_exists: AsyncMock, + mock_process_ha_config_upgrade: Mock, + domain: str, +) -> None: + """Test recovery mode still starts if cloud or backup fails to set up.""" + with patch( + f"homeassistant.components.{domain}.async_setup", + side_effect=Exception(f"{domain} setup failed"), + ): + hass = await bootstrap.async_setup_hass( + runner.RuntimeConfig( + config_dir=get_test_config_dir(), + verbose=False, + log_rotate_days=10, + log_file="", + log_no_color=False, + skip_pip=True, + recovery_mode=True, + ), + ) + + assert "recovery_mode" in hass.config.components + assert domain not in hass.config.components + + @pytest.mark.usefixtures("mock_hass_config") async def test_setup_hass_safe_mode( mock_enable_logging: AsyncMock,