diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index 0225d723d20..8201cbc5b7a 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -666,18 +666,13 @@ def websocket_get_themes( hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any] ) -> None: """Handle get themes command.""" - if hass.config.recovery_mode: + if hass.config.recovery_mode or hass.config.safe_mode: connection.send_message( websocket_api.result_message( msg["id"], { - "themes": { - "recovery_mode": { - "primary-color": "#db4437", - "accent-color": "#ffca28", - } - }, - "default_theme": "recovery_mode", + "themes": {}, + "default_theme": "default", }, ) ) diff --git a/tests/components/frontend/test_init.py b/tests/components/frontend/test_init.py index 4f75bc2e790..e3f0d7f35d5 100644 --- a/tests/components/frontend/test_init.py +++ b/tests/components/frontend/test_init.py @@ -180,10 +180,17 @@ async def test_themes_api(hass: HomeAssistant, themes_ws_client) -> None: await themes_ws_client.send_json({"id": 6, "type": "frontend/get_themes"}) msg = await themes_ws_client.receive_json() - assert msg["result"]["default_theme"] == "recovery_mode" - assert msg["result"]["themes"] == { - "recovery_mode": {"primary-color": "#db4437", "accent-color": "#ffca28"} - } + assert msg["result"]["default_theme"] == "default" + assert msg["result"]["themes"] == {} + + # safe mode + hass.config.recovery_mode = False + hass.config.safe_mode = True + await themes_ws_client.send_json({"id": 7, "type": "frontend/get_themes"}) + msg = await themes_ws_client.receive_json() + + assert msg["result"]["default_theme"] == "default" + assert msg["result"]["themes"] == {} async def test_themes_persist(