1 """Config flow for Local To-do integration."""
3 from __future__
import annotations
8 import voluptuous
as vol
13 from .const
import CONF_STORAGE_KEY, CONF_TODO_LIST_NAME, DOMAIN
15 _LOGGER = logging.getLogger(__name__)
17 STEP_USER_DATA_SCHEMA = vol.Schema(
19 vol.Required(CONF_TODO_LIST_NAME): str,
25 """Handle a config flow for Local To-do."""
30 self, user_input: dict[str, Any] |
None =
None
31 ) -> ConfigFlowResult:
32 """Handle the initial step."""
33 errors: dict[str, str] = {}
34 if user_input
is not None:
35 key =
slugify(user_input[CONF_TODO_LIST_NAME])
37 user_input[CONF_STORAGE_KEY] = key
39 title=user_input[CONF_TODO_LIST_NAME], data=user_input
43 step_id=
"user", data_schema=STEP_USER_DATA_SCHEMA, errors=errors
ConfigFlowResult async_step_user(self, dict[str, Any]|None user_input=None)
ConfigFlowResult async_create_entry(self, *str title, Mapping[str, Any] data, str|None description=None, Mapping[str, str]|None description_placeholders=None, Mapping[str, Any]|None options=None)
None _async_abort_entries_match(self, dict[str, Any]|None match_dict=None)
ConfigFlowResult async_show_form(self, *str|None step_id=None, vol.Schema|None data_schema=None, dict[str, str]|None errors=None, Mapping[str, str]|None description_placeholders=None, bool|None last_step=None, str|None preview=None)
_FlowResultT async_show_form(self, *str|None step_id=None, vol.Schema|None data_schema=None, dict[str, str]|None errors=None, Mapping[str, str]|None description_placeholders=None, bool|None last_step=None, str|None preview=None)
_FlowResultT async_create_entry(self, *str|None title=None, Mapping[str, Any] data, str|None description=None, Mapping[str, str]|None description_placeholders=None)