mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
No aliases in workday (#103091)
This commit is contained in:
parent
55a4769172
commit
193ce08b39
@ -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)),
|
||||
)
|
||||
),
|
||||
}
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user