Use CountrySelector in Workday (#101879)

This commit is contained in:
G Johansson 2023-10-12 17:39:08 +02:00 committed by GitHub
parent e5f37050a9
commit b6d8211c6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View file

@ -16,6 +16,8 @@ from homeassistant.core import callback
from homeassistant.data_entry_flow import AbortFlow, FlowResult
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.selector import (
CountrySelector,
CountrySelectorConfig,
NumberSelector,
NumberSelectorConfig,
NumberSelectorMode,
@ -113,11 +115,9 @@ def validate_custom_dates(user_input: dict[str, Any]) -> None:
DATA_SCHEMA_SETUP = vol.Schema(
{
vol.Required(CONF_NAME, default=DEFAULT_NAME): TextSelector(),
vol.Optional(CONF_COUNTRY): SelectSelector(
SelectSelectorConfig(
options=list(list_supported_countries()),
mode=SelectSelectorMode.DROPDOWN,
translation_key=CONF_COUNTRY,
vol.Optional(CONF_COUNTRY): CountrySelector(
CountrySelectorConfig(
countries=list(list_supported_countries()),
)
),
}

View file

@ -69,11 +69,6 @@
}
},
"selector": {
"country": {
"options": {
"none": "No country"
}
},
"province": {
"options": {
"none": "No subdivision"