mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Address late review for Holiday (#105121)
This commit is contained in:
parent
7424c296b7
commit
81d05acd07
@ -28,7 +28,9 @@ class HolidayConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
data: dict[str, Any] = {}
|
def __init__(self) -> None:
|
||||||
|
"""Initialize the config flow."""
|
||||||
|
self.data: dict[str, Any] = {}
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -37,7 +39,7 @@ class HolidayConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
self.data = user_input
|
self.data = user_input
|
||||||
|
|
||||||
selected_country = self.data[CONF_COUNTRY]
|
selected_country = user_input[CONF_COUNTRY]
|
||||||
|
|
||||||
if SUPPORTED_COUNTRIES[selected_country]:
|
if SUPPORTED_COUNTRIES[selected_country]:
|
||||||
return await self.async_step_province()
|
return await self.async_step_province()
|
||||||
@ -46,7 +48,7 @@ class HolidayConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
locale = Locale(self.hass.config.language)
|
locale = Locale(self.hass.config.language)
|
||||||
title = locale.territories[selected_country]
|
title = locale.territories[selected_country]
|
||||||
return self.async_create_entry(title=title, data=self.data)
|
return self.async_create_entry(title=title, data=user_input)
|
||||||
|
|
||||||
user_schema = vol.Schema(
|
user_schema = vol.Schema(
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user