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.data_entry_flow import AbortFlow, FlowResult
from homeassistant.exceptions import HomeAssistantError from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.selector import ( from homeassistant.helpers.selector import (
CountrySelector,
CountrySelectorConfig,
NumberSelector, NumberSelector,
NumberSelectorConfig, NumberSelectorConfig,
NumberSelectorMode, NumberSelectorMode,
@ -113,11 +115,9 @@ def validate_custom_dates(user_input: dict[str, Any]) -> None:
DATA_SCHEMA_SETUP = vol.Schema( 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): SelectSelector( vol.Optional(CONF_COUNTRY): CountrySelector(
SelectSelectorConfig( CountrySelectorConfig(
options=list(list_supported_countries()), countries=list(list_supported_countries()),
mode=SelectSelectorMode.DROPDOWN,
translation_key=CONF_COUNTRY,
) )
), ),
} }

View File

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