No aliases in workday (#103091)

This commit is contained in:
G Johansson 2023-10-31 11:35:09 +01:00 committed by GitHub
parent 55a4769172
commit 193ce08b39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -54,7 +54,7 @@ def add_province_to_schema(
if not country:
return schema
all_countries = list_supported_countries()
all_countries = list_supported_countries(include_aliases=False)
if not all_countries.get(country):
return schema
@ -117,7 +117,7 @@ DATA_SCHEMA_SETUP = vol.Schema(
vol.Required(CONF_NAME, default=DEFAULT_NAME): TextSelector(),
vol.Optional(CONF_COUNTRY): CountrySelector(
CountrySelectorConfig(
countries=list(list_supported_countries()),
countries=list(list_supported_countries(include_aliases=False)),
)
),
}

View File

@ -43,7 +43,7 @@ class CountryFixFlow(RepairsFlow):
) -> data_entry_flow.FlowResult:
"""Handle the country step of a fix flow."""
if user_input is not None:
all_countries = list_supported_countries()
all_countries = list_supported_countries(include_aliases=False)
if not all_countries[user_input[CONF_COUNTRY]]:
options = dict(self.entry.options)
new_options = {**options, **user_input, CONF_PROVINCE: None}
@ -61,7 +61,9 @@ class CountryFixFlow(RepairsFlow):
{
vol.Required(CONF_COUNTRY): SelectSelector(
SelectSelectorConfig(
options=sorted(list_supported_countries()),
options=sorted(
list_supported_countries(include_aliases=False)
),
mode=SelectSelectorMode.DROPDOWN,
)
)
@ -83,7 +85,9 @@ class CountryFixFlow(RepairsFlow):
return self.async_create_entry(data={})
assert self.country
country_provinces = list_supported_countries()[self.country]
country_provinces = list_supported_countries(include_aliases=False)[
self.country
]
return self.async_show_form(
step_id="province",
data_schema=vol.Schema(