add error logging and display error to user

This commit is contained in:
danaues 2022-10-29 23:45:29 +00:00
commit 14019695a4
14 changed files with 28 additions and 13 deletions

View file

@ -98,6 +98,8 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
]
for configured_light in data[CONF_LIGHTS]:
if configured_light not in all_lights:
errors = {"lights":"entity_missing"}
_LOGGER.error("%s: light entity %s is configured, but was not found", data[CONF_NAME], configured_light)
all_lights.append(configured_light)
to_replace = {CONF_LIGHTS: cv.multi_select(sorted(all_lights))}

View file

@ -46,7 +46,8 @@
}
},
"error": {
"option_error": "Invalid option"
"option_error": "Invalid option",
"entity_missing": "One or more selected light entities are missing from Home Assistant"
}
}
}

View file

@ -43,7 +43,8 @@
}
},
"error": {
"option_error": "Ugyldig indstilling"
"option_error": "Ugyldig indstilling",
"entity_missing": "Et udvalgt lys blev ikke fundet "
}
}
}

View file

@ -43,7 +43,8 @@
}
},
"error": {
"option_error": "Fehlerhafte Option"
"option_error": "Fehlerhafte Option",
"entity_missing": "Ein ausgewähltes Licht wurde nicht gefunden"
}
}
}

View file

@ -47,7 +47,8 @@
}
},
"error": {
"option_error": "Invalid option"
"option_error": "Invalid option",
"entity_missing": "One or more selected light entities are missing from Home Assistant"
}
}
}

View file

@ -43,7 +43,8 @@
}
},
"error": {
"option_error": "Vigane suvand"
"option_error": "Vigane suvand",
"entity_missing": "Valitud valgust ei leitud"
}
}
}

View file

@ -44,7 +44,8 @@
}
},
"error": {
"option_error": "Option non valide"
"option_error": "Option non valide",
"entity_missing": "Une lumière sélectionnée na pas été trouvée"
}
}
}

View file

@ -45,7 +45,8 @@
}
},
"error": {
"option_error": "Opzione non valida"
"option_error": "Opzione non valida",
"entity_missing": "Non è stata trovata una luce selezionata"
}
}
}

View file

@ -43,7 +43,8 @@
}
},
"error":{
"option_error":"En eller flere valgte innstillinger er ugyldige"
"option_error":"En eller flere valgte innstillinger er ugyldige",
"entity_missing": "Et utvalgt lys ble ikke funnet"
}
}
}

View file

@ -44,7 +44,8 @@
}
},
"error": {
"option_error": "Błędne opcje"
"option_error": "Błędne opcje",
"entity_missing": "Nie znaleziono wybranego światła"
}
}
}

View file

@ -44,7 +44,8 @@
}
},
"error": {
"option_error": "Opção inválida"
"option_error": "Opção inválida",
"entity_missing": "Uma luz selecionada não foi encontrada"
}
}
}

View file

@ -45,7 +45,8 @@
}
},
"error": {
"option_error": "Ошибка в настройках!"
"option_error": "Ошибка в настройках!",
"entity_missing": "Выбранный индикатор не найден"
}
}
}

View file

@ -46,7 +46,8 @@
}
},
"error": {
"option_error": "Ogiltlig inställning"
"option_error": "Ogiltlig inställning",
"entity_missing": "Ett valt ljus hittades inte"
}
}
}

View file

@ -43,7 +43,8 @@
}
},
"error": {
"option_error": "Хибна опція"
"option_error": "Хибна опція",
"entity_missing": "Вибраного світла в домашньому помічнику не знайшли"
}
}
}