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:
|
if not country:
|
||||||
return schema
|
return schema
|
||||||
|
|
||||||
all_countries = list_supported_countries()
|
all_countries = list_supported_countries(include_aliases=False)
|
||||||
if not all_countries.get(country):
|
if not all_countries.get(country):
|
||||||
return schema
|
return schema
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ DATA_SCHEMA_SETUP = vol.Schema(
|
|||||||
vol.Required(CONF_NAME, default=DEFAULT_NAME): TextSelector(),
|
vol.Required(CONF_NAME, default=DEFAULT_NAME): TextSelector(),
|
||||||
vol.Optional(CONF_COUNTRY): CountrySelector(
|
vol.Optional(CONF_COUNTRY): CountrySelector(
|
||||||
CountrySelectorConfig(
|
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:
|
) -> data_entry_flow.FlowResult:
|
||||||
"""Handle the country step of a fix flow."""
|
"""Handle the country step of a fix flow."""
|
||||||
if user_input is not None:
|
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]]:
|
if not all_countries[user_input[CONF_COUNTRY]]:
|
||||||
options = dict(self.entry.options)
|
options = dict(self.entry.options)
|
||||||
new_options = {**options, **user_input, CONF_PROVINCE: None}
|
new_options = {**options, **user_input, CONF_PROVINCE: None}
|
||||||
@ -61,7 +61,9 @@ class CountryFixFlow(RepairsFlow):
|
|||||||
{
|
{
|
||||||
vol.Required(CONF_COUNTRY): SelectSelector(
|
vol.Required(CONF_COUNTRY): SelectSelector(
|
||||||
SelectSelectorConfig(
|
SelectSelectorConfig(
|
||||||
options=sorted(list_supported_countries()),
|
options=sorted(
|
||||||
|
list_supported_countries(include_aliases=False)
|
||||||
|
),
|
||||||
mode=SelectSelectorMode.DROPDOWN,
|
mode=SelectSelectorMode.DROPDOWN,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -83,7 +85,9 @@ class CountryFixFlow(RepairsFlow):
|
|||||||
return self.async_create_entry(data={})
|
return self.async_create_entry(data={})
|
||||||
|
|
||||||
assert self.country
|
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(
|
return self.async_show_form(
|
||||||
step_id="province",
|
step_id="province",
|
||||||
data_schema=vol.Schema(
|
data_schema=vol.Schema(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user