diff --git a/.core_files.yaml b/.core_files.yaml index 0817d5c8261..b3e854de04b 100644 --- a/.core_files.yaml +++ b/.core_files.yaml @@ -96,8 +96,8 @@ components: &components - homeassistant/components/persistent_notification/** - homeassistant/components/person/** - homeassistant/components/recorder/** + - homeassistant/components/recovery_mode/** - homeassistant/components/repairs/** - - homeassistant/components/safe_mode/** - homeassistant/components/script/** - homeassistant/components/shopping_list/** - homeassistant/components/ssdp/** diff --git a/CODEOWNERS b/CODEOWNERS index 87ac2cebfcb..e763baa7e79 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1035,6 +1035,8 @@ build.json @home-assistant/supervisor /tests/components/recollect_waste/ @bachya /homeassistant/components/recorder/ @home-assistant/core /tests/components/recorder/ @home-assistant/core +/homeassistant/components/recovery_mode/ @home-assistant/core +/tests/components/recovery_mode/ @home-assistant/core /homeassistant/components/rejseplanen/ @DarkFox /homeassistant/components/remote/ @home-assistant/core /tests/components/remote/ @home-assistant/core @@ -1085,8 +1087,6 @@ build.json @home-assistant/supervisor /tests/components/rympro/ @OnFreund @elad-bar @maorcc /homeassistant/components/sabnzbd/ @shaiu /tests/components/sabnzbd/ @shaiu -/homeassistant/components/safe_mode/ @home-assistant/core -/tests/components/safe_mode/ @home-assistant/core /homeassistant/components/saj/ @fredericvl /homeassistant/components/samsungtv/ @chemelli74 @epenet /tests/components/samsungtv/ @chemelli74 @epenet diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index 7f6c29d8105..89aa5c05d0d 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -194,7 +194,7 @@ async def async_setup_hass( http_conf = (await http.async_get_last_config(hass)) or {} await async_from_config_dict( - {"safe_mode": {}, "http": http_conf}, + {"recovery_mode": {}, "http": http_conf}, hass, ) diff --git a/homeassistant/components/safe_mode/__init__.py b/homeassistant/components/recovery_mode/__init__.py similarity index 70% rename from homeassistant/components/safe_mode/__init__.py rename to homeassistant/components/recovery_mode/__init__.py index 3ed2d4476af..46a8d320663 100644 --- a/homeassistant/components/safe_mode/__init__.py +++ b/homeassistant/components/recovery_mode/__init__.py @@ -1,22 +1,22 @@ -"""The Safe Mode integration.""" +"""The Recovery Mode integration.""" from homeassistant.components import persistent_notification from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import ConfigType -DOMAIN = "safe_mode" +DOMAIN = "recovery_mode" CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: - """Set up the Safe Mode component.""" + """Set up the Recovery Mode component.""" persistent_notification.async_create( hass, ( - "Home Assistant is running in safe mode. Check [the error" + "Home Assistant is running in recovery mode. Check [the error" " log](/config/logs) to see what went wrong." ), - "Safe Mode", + "Recovery Mode", ) return True diff --git a/homeassistant/components/safe_mode/manifest.json b/homeassistant/components/recovery_mode/manifest.json similarity index 59% rename from homeassistant/components/safe_mode/manifest.json rename to homeassistant/components/recovery_mode/manifest.json index 344b530db2e..1e46a4acde6 100644 --- a/homeassistant/components/safe_mode/manifest.json +++ b/homeassistant/components/recovery_mode/manifest.json @@ -1,10 +1,10 @@ { - "domain": "safe_mode", - "name": "Safe Mode", + "domain": "recovery_mode", + "name": "Recovery Mode", "codeowners": ["@home-assistant/core"], "config_flow": false, "dependencies": ["frontend", "persistent_notification", "cloud"], - "documentation": "https://www.home-assistant.io/integrations/safe_mode", + "documentation": "https://www.home-assistant.io/integrations/recovery_mode", "integration_type": "system", "quality_scale": "internal" } diff --git a/script/hassfest/manifest.py b/script/hassfest/manifest.py index acdea23444d..d5acde61262 100644 --- a/script/hassfest/manifest.py +++ b/script/hassfest/manifest.py @@ -98,8 +98,8 @@ NO_IOT_CLASS = [ "proxy", "python_script", "raspberry_pi", + "recovery_mode", "repairs", - "safe_mode", "schedule", "script", "search", diff --git a/tests/components/recovery_mode/__init__.py b/tests/components/recovery_mode/__init__.py new file mode 100644 index 00000000000..1f2f2fcadd8 --- /dev/null +++ b/tests/components/recovery_mode/__init__.py @@ -0,0 +1 @@ +"""Tests for the Recovery Mode integration.""" diff --git a/tests/components/safe_mode/test_init.py b/tests/components/recovery_mode/test_init.py similarity index 70% rename from tests/components/safe_mode/test_init.py rename to tests/components/recovery_mode/test_init.py index 82f5f5180da..ec8db443ef1 100644 --- a/tests/components/safe_mode/test_init.py +++ b/tests/components/recovery_mode/test_init.py @@ -1,4 +1,4 @@ -"""Tests for safe mode integration.""" +"""Tests for the Recovery Mode integration.""" from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component @@ -6,8 +6,8 @@ from tests.common import async_get_persistent_notifications async def test_works(hass: HomeAssistant) -> None: - """Test safe mode works.""" - assert await async_setup_component(hass, "safe_mode", {}) + """Test Recovery Mode works.""" + assert await async_setup_component(hass, "recovery_mode", {}) await hass.async_block_till_done() notifications = async_get_persistent_notifications(hass) assert len(notifications) == 1 diff --git a/tests/components/safe_mode/__init__.py b/tests/components/safe_mode/__init__.py deleted file mode 100644 index 3732fef17cb..00000000000 --- a/tests/components/safe_mode/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the Safe Mode integration.""" diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py index 6938acb9cc9..d7901b0566e 100644 --- a/tests/test_bootstrap.py +++ b/tests/test_bootstrap.py @@ -103,7 +103,7 @@ async def test_empty_setup(hass: HomeAssistant) -> None: assert domain in hass.config.components, domain -async def test_core_failure_loads_safe_mode( +async def test_core_failure_loads_recovery_mode( hass: HomeAssistant, caplog: pytest.LogCaptureFixture ) -> None: """Test failing core setup aborts further setup.""" @@ -495,7 +495,7 @@ async def test_setup_hass( assert "Waiting on integrations to complete setup" not in caplog.text assert "browser" in hass.config.components - assert "safe_mode" not in hass.config.components + assert "recovery_mode" not in hass.config.components assert len(mock_enable_logging.mock_calls) == 1 assert mock_enable_logging.mock_calls[0][1] == ( @@ -578,7 +578,7 @@ async def test_setup_hass_invalid_yaml( ), ) - assert "safe_mode" in hass.config.components + assert "recovery_mode" in hass.config.components assert len(mock_mount_local_lib_path.mock_calls) == 0 @@ -609,7 +609,7 @@ async def test_setup_hass_config_dir_nonexistent( ) -async def test_setup_hass_safe_mode( +async def test_setup_hass_recovery_mode( mock_enable_logging: Mock, mock_is_virtual_env: Mock, mock_mount_local_lib_path: AsyncMock, @@ -634,7 +634,7 @@ async def test_setup_hass_safe_mode( ), ) - assert "safe_mode" in hass.config.components + assert "recovery_mode" in hass.config.components assert len(mock_mount_local_lib_path.mock_calls) == 0 # Validate we didn't try to set up config entry. @@ -665,7 +665,7 @@ async def test_setup_hass_invalid_core_config( ), ) - assert "safe_mode" in hass.config.components + assert "recovery_mode" in hass.config.components @pytest.mark.parametrize( @@ -681,7 +681,7 @@ async def test_setup_hass_invalid_core_config( } ], ) -async def test_setup_safe_mode_if_no_frontend( +async def test_setup_recovery_mode_if_no_frontend( mock_hass_config: None, mock_enable_logging: Mock, mock_is_virtual_env: Mock, @@ -690,7 +690,7 @@ async def test_setup_safe_mode_if_no_frontend( mock_process_ha_config_upgrade: Mock, event_loop: asyncio.AbstractEventLoop, ) -> None: - """Test we setup safe mode if frontend didn't load.""" + """Test we setup recovery mode if frontend didn't load.""" verbose = Mock() log_rotate_days = Mock() log_file = Mock() @@ -708,7 +708,7 @@ async def test_setup_safe_mode_if_no_frontend( ), ) - assert "safe_mode" in hass.config.components + assert "recovery_mode" in hass.config.components assert hass.config.config_dir == get_test_config_dir() assert hass.config.skip_pip assert hass.config.internal_url == "http://192.168.1.100:8123"