Prefer YAML config mode in Lovelace system_health (#59835)

pull/59839/head
Joakim Sørensen 2021-11-17 14:47:22 +01:00 committed by GitHub
parent b6dea3c6cb
commit edbe54c346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -140,6 +140,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
hass.data[DOMAIN] = {
# We store a dictionary mapping url_path: config. None is the default.
"mode": mode,
"dashboards": {None: default_config},
"resources": resource_collection,
"yaml_dashboards": config[DOMAIN].get(CONF_DASHBOARDS, {}),

View File

@ -38,7 +38,9 @@ async def system_health_info(hass):
else:
health_info[key] = dashboard[key]
if MODE_STORAGE in modes:
if hass.data[DOMAIN][CONF_MODE] == MODE_YAML:
health_info[CONF_MODE] = MODE_YAML
elif MODE_STORAGE in modes:
health_info[CONF_MODE] = MODE_STORAGE
elif MODE_YAML in modes:
health_info[CONF_MODE] = MODE_YAML