mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Required option_flow values for here_travel_time (#77651)
This commit is contained in:
parent
6f8b032a6e
commit
dec2661322
@ -24,7 +24,6 @@ from homeassistant.helpers.selector import (
|
||||
EntitySelector,
|
||||
LocationSelector,
|
||||
TimeSelector,
|
||||
selector,
|
||||
)
|
||||
|
||||
from .const import (
|
||||
@ -361,7 +360,8 @@ class HERETravelTimeOptionsFlow(config_entries.OptionsFlow):
|
||||
menu_options=["departure_time", "no_time"],
|
||||
)
|
||||
|
||||
options = {
|
||||
schema = vol.Schema(
|
||||
{
|
||||
vol.Optional(
|
||||
CONF_TRAFFIC_MODE,
|
||||
default=self.config_entry.options.get(
|
||||
@ -381,8 +381,9 @@ class HERETravelTimeOptionsFlow(config_entries.OptionsFlow):
|
||||
),
|
||||
): vol.In(UNITS),
|
||||
}
|
||||
)
|
||||
|
||||
return self.async_show_form(step_id="init", data_schema=vol.Schema(options))
|
||||
return self.async_show_form(step_id="init", data_schema=schema)
|
||||
|
||||
async def async_step_no_time(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
@ -398,12 +399,12 @@ class HERETravelTimeOptionsFlow(config_entries.OptionsFlow):
|
||||
self._config[CONF_ARRIVAL_TIME] = user_input[CONF_ARRIVAL_TIME]
|
||||
return self.async_create_entry(title="", data=self._config)
|
||||
|
||||
options = {"arrival_time": selector({TimeSelector.selector_type: {}})}
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="arrival_time", data_schema=vol.Schema(options)
|
||||
schema = vol.Schema(
|
||||
{vol.Required(CONF_ARRIVAL_TIME, default="00:00:00"): TimeSelector()}
|
||||
)
|
||||
|
||||
return self.async_show_form(step_id="arrival_time", data_schema=schema)
|
||||
|
||||
async def async_step_departure_time(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> FlowResult:
|
||||
@ -412,8 +413,8 @@ class HERETravelTimeOptionsFlow(config_entries.OptionsFlow):
|
||||
self._config[CONF_DEPARTURE_TIME] = user_input[CONF_DEPARTURE_TIME]
|
||||
return self.async_create_entry(title="", data=self._config)
|
||||
|
||||
options = {"departure_time": selector({TimeSelector.selector_type: {}})}
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="departure_time", data_schema=vol.Schema(options)
|
||||
schema = vol.Schema(
|
||||
{vol.Required(CONF_DEPARTURE_TIME, default="00:00:00"): TimeSelector()}
|
||||
)
|
||||
|
||||
return self.async_show_form(step_id="departure_time", data_schema=schema)
|
||||
|
Loading…
x
Reference in New Issue
Block a user