Prefer YAML config mode in Lovelace system_health (#59835)
This commit is contained in:
parent
b6dea3c6cb
commit
edbe54c346
2 changed files with 4 additions and 1 deletions
|
@ -140,6 +140,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
|
|
||||||
hass.data[DOMAIN] = {
|
hass.data[DOMAIN] = {
|
||||||
# We store a dictionary mapping url_path: config. None is the default.
|
# We store a dictionary mapping url_path: config. None is the default.
|
||||||
|
"mode": mode,
|
||||||
"dashboards": {None: default_config},
|
"dashboards": {None: default_config},
|
||||||
"resources": resource_collection,
|
"resources": resource_collection,
|
||||||
"yaml_dashboards": config[DOMAIN].get(CONF_DASHBOARDS, {}),
|
"yaml_dashboards": config[DOMAIN].get(CONF_DASHBOARDS, {}),
|
||||||
|
|
|
@ -38,7 +38,9 @@ async def system_health_info(hass):
|
||||||
else:
|
else:
|
||||||
health_info[key] = dashboard[key]
|
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
|
health_info[CONF_MODE] = MODE_STORAGE
|
||||||
elif MODE_YAML in modes:
|
elif MODE_YAML in modes:
|
||||||
health_info[CONF_MODE] = MODE_YAML
|
health_info[CONF_MODE] = MODE_YAML
|
||||||
|
|
Loading…
Add table
Reference in a new issue