Extend safe mode (#31927)

* Extend safe mode

* Add safe mode boolean to config JSON output and default Lovelace

* Add safe mode to frontend

* Update accent color
This commit is contained in:
Paulus Schoutsen 2020-02-18 11:52:38 -08:00 committed by GitHub
parent 245482d802
commit beee1298c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 131 additions and 17 deletions

View file

@ -126,6 +126,16 @@ async def test_themes_api(hass, hass_ws_client):
assert msg["result"]["default_theme"] == "default"
assert msg["result"]["themes"] == {"happy": {"primary-color": "red"}}
# safe mode
hass.config.safe_mode = True
await client.send_json({"id": 6, "type": "frontend/get_themes"})
msg = await client.receive_json()
assert msg["result"]["default_theme"] == "safe_mode"
assert msg["result"]["themes"] == {
"safe_mode": {"primary-color": "#db4437", "accent-color": "#eeee02"}
}
async def test_themes_set_theme(hass, hass_ws_client):
"""Test frontend.set_theme service."""