1 """Config flow for Times of the Day integration."""
3 from __future__
import annotations
5 from collections.abc
import Mapping
6 from typing
import Any, cast
8 import voluptuous
as vol
13 SchemaConfigFlowHandler,
17 from .const
import CONF_AFTER_TIME, CONF_BEFORE_TIME, DOMAIN
19 OPTIONS_SCHEMA = vol.Schema(
21 vol.Required(CONF_AFTER_TIME): selector.TimeSelector(),
22 vol.Required(CONF_BEFORE_TIME): selector.TimeSelector(),
26 CONFIG_SCHEMA = vol.Schema(
28 vol.Required(CONF_NAME): selector.TextSelector(),
30 ).extend(OPTIONS_SCHEMA.schema)
42 """Handle a config or options flow for Times of the Day."""
44 config_flow = CONFIG_FLOW
45 options_flow = OPTIONS_FLOW
48 """Return config entry title."""
49 return cast(str, options[
"name"])
str async_config_entry_title(self, Mapping[str, Any] options)