1 """Config flow for Google Translate text-to-speech integration."""
3 from __future__
import annotations
7 import voluptuous
as vol
21 STEP_USER_DATA_SCHEMA = vol.Schema(
23 vol.Optional(CONF_LANG, default=DEFAULT_LANG): vol.In(SUPPORT_LANGUAGES),
24 vol.Optional(CONF_TLD, default=DEFAULT_TLD): vol.In(SUPPORT_TLD),
30 """Handle a config flow for Google Translate text-to-speech."""
35 self, user_input: dict[str, Any] |
None =
None
36 ) -> ConfigFlowResult:
37 """Handle the initial step."""
38 if user_input
is not None:
41 CONF_LANG: user_input[CONF_LANG],
42 CONF_TLD: user_input[CONF_TLD],
46 title=
"Google Translate text-to-speech", data=user_input
52 self, data: dict[str, Any] |
None =
None
53 ) -> ConfigFlowResult:
54 """Handle a flow initialized by onboarding."""
56 title=
"Google Translate text-to-speech",
57 data={CONF_LANG: DEFAULT_LANG, CONF_TLD: DEFAULT_TLD},
ConfigFlowResult async_step_onboarding(self, dict[str, Any]|None data=None)
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)