Fix hassfest validation

This commit is contained in:
Jules 2024-05-20 21:14:02 +02:00
parent e1ffb2ec8e
commit 8d2fcbefb5
Signed by: jdejaegh
GPG key ID: 99D6D184CA66933A
5 changed files with 8 additions and 8 deletions

View file

@ -42,7 +42,7 @@ class IrmKmiConfigFlow(ConfigFlow, domain=DOMAIN):
if user_input: if user_input:
if CONF_LANGUAGE_OVERRIDE in user_input: if CONF_LANGUAGE_OVERRIDE in user_input:
user_input[CONF_LANGUAGE_OVERRIDE] = None if user_input[CONF_LANGUAGE_OVERRIDE] == 'None' \ user_input[CONF_LANGUAGE_OVERRIDE] = None if user_input[CONF_LANGUAGE_OVERRIDE] == 'none' \
else user_input[CONF_LANGUAGE_OVERRIDE] else user_input[CONF_LANGUAGE_OVERRIDE]
_LOGGER.debug(f"Provided config user is: {user_input}") _LOGGER.debug(f"Provided config user is: {user_input}")
@ -99,7 +99,7 @@ class IrmKmiConfigFlow(ConfigFlow, domain=DOMAIN):
mode=SelectSelectorMode.DROPDOWN, mode=SelectSelectorMode.DROPDOWN,
translation_key=CONF_USE_DEPRECATED_FORECAST)), translation_key=CONF_USE_DEPRECATED_FORECAST)),
vol.Optional(CONF_LANGUAGE_OVERRIDE, default='None'): vol.Optional(CONF_LANGUAGE_OVERRIDE, default='none'):
SelectSelector(SelectSelectorConfig(options=CONF_LANGUAGE_OVERRIDE_OPTIONS, SelectSelector(SelectSelectorConfig(options=CONF_LANGUAGE_OVERRIDE_OPTIONS,
mode=SelectSelectorMode.DROPDOWN, mode=SelectSelectorMode.DROPDOWN,
translation_key=CONF_LANGUAGE_OVERRIDE)) translation_key=CONF_LANGUAGE_OVERRIDE))
@ -116,7 +116,7 @@ class IrmKmiOptionFlow(OptionsFlow):
"""Manage the options.""" """Manage the options."""
if user_input is not None: if user_input is not None:
if CONF_LANGUAGE_OVERRIDE in user_input: if CONF_LANGUAGE_OVERRIDE in user_input:
user_input[CONF_LANGUAGE_OVERRIDE] = None if user_input[CONF_LANGUAGE_OVERRIDE] == 'None' \ user_input[CONF_LANGUAGE_OVERRIDE] = None if user_input[CONF_LANGUAGE_OVERRIDE] == 'none' \
else user_input[CONF_LANGUAGE_OVERRIDE] else user_input[CONF_LANGUAGE_OVERRIDE]
_LOGGER.debug(user_input) _LOGGER.debug(user_input)
return self.async_create_entry(data=user_input) return self.async_create_entry(data=user_input)
@ -139,7 +139,7 @@ class IrmKmiOptionFlow(OptionsFlow):
translation_key=CONF_USE_DEPRECATED_FORECAST)), translation_key=CONF_USE_DEPRECATED_FORECAST)),
vol.Optional(CONF_LANGUAGE_OVERRIDE, vol.Optional(CONF_LANGUAGE_OVERRIDE,
default=str(get_config_value(self.config_entry, CONF_LANGUAGE_OVERRIDE))): default=str(get_config_value(self.config_entry, CONF_LANGUAGE_OVERRIDE)).lower()):
SelectSelector(SelectSelectorConfig(options=CONF_LANGUAGE_OVERRIDE_OPTIONS, SelectSelector(SelectSelectorConfig(options=CONF_LANGUAGE_OVERRIDE_OPTIONS,
mode=SelectSelectorMode.DROPDOWN, mode=SelectSelectorMode.DROPDOWN,
translation_key=CONF_LANGUAGE_OVERRIDE)) translation_key=CONF_LANGUAGE_OVERRIDE))

View file

@ -61,7 +61,7 @@ CONF_USE_DEPRECATED_FORECAST_OPTIONS: Final = [
CONF_LANGUAGE_OVERRIDE: Final = 'language_override' CONF_LANGUAGE_OVERRIDE: Final = 'language_override'
CONF_LANGUAGE_OVERRIDE_OPTIONS: Final = [ CONF_LANGUAGE_OVERRIDE_OPTIONS: Final = [
'None', "fr", "nl", "de", "en" 'none', "fr", "nl", "de", "en"
] ]
REPAIR_SOLUTION: Final = "repair_solution" REPAIR_SOLUTION: Final = "repair_solution"

View file

@ -48,7 +48,7 @@
}, },
"language_override": { "language_override": {
"options": { "options": {
"None": "Follow Home Assistant server language", "none": "Follow Home Assistant server language",
"fr": "French", "fr": "French",
"nl": "Dutch", "nl": "Dutch",
"de": "German", "de": "German",

View file

@ -48,7 +48,7 @@
}, },
"language_override": { "language_override": {
"options": { "options": {
"None": "Langue du serveur Home Assistant", "none": "Langue du serveur Home Assistant",
"fr": "Français", "fr": "Français",
"nl": "Néerlandais", "nl": "Néerlandais",
"de": "Allemand", "de": "Allemand",

View file

@ -48,7 +48,7 @@
}, },
"language_override": { "language_override": {
"options": { "options": {
"None": "Zelfde als Home Assistant server taal", "none": "Zelfde als Home Assistant server taal",
"fr": "Frans", "fr": "Frans",
"nl": "Nederlands", "nl": "Nederlands",
"de": "Duits", "de": "Duits",