1 """Config flow to configure the honeywell integration."""
3 from __future__
import annotations
5 from collections.abc
import Mapping
9 import voluptuous
as vol
22 CONF_COOL_AWAY_TEMPERATURE,
23 CONF_HEAT_AWAY_TEMPERATURE,
24 DEFAULT_COOL_AWAY_TEMPERATURE,
25 DEFAULT_HEAT_AWAY_TEMPERATURE,
29 REAUTH_SCHEMA = vol.Schema(
31 vol.Required(CONF_USERNAME): str,
32 vol.Required(CONF_PASSWORD): str,
38 """Handle a honeywell config flow."""
43 self, entry_data: Mapping[str, Any]
44 ) -> ConfigFlowResult:
45 """Handle re-authentication with Honeywell."""
49 self, user_input: dict[str, Any] |
None =
None
50 ) -> ConfigFlowResult:
51 """Confirm re-authentication with Honeywell."""
52 errors: dict[str, str] = {}
58 username=user_input[CONF_USERNAME],
59 password=user_input[CONF_PASSWORD],
62 except aiosomecomfort.AuthError:
63 errors[
"base"] =
"invalid_auth"
65 aiosomecomfort.ConnectionError,
66 aiosomecomfort.ConnectionTimeout,
69 errors[
"base"] =
"cannot_connect"
73 data_updates=user_input,
77 step_id=
"reauth_confirm",
79 REAUTH_SCHEMA, reauth_entry.data
82 description_placeholders={
"name":
"Honeywell"},
86 """Create config entry. Show the setup form to the user."""
87 errors: dict[str, str] = {}
88 if user_input
is not None:
90 await self.
is_validis_valid(**user_input)
91 except aiosomecomfort.AuthError:
92 errors[
"base"] =
"invalid_auth"
94 aiosomecomfort.ConnectionError,
95 aiosomecomfort.ConnectionTimeout,
98 errors[
"base"] =
"cannot_connect"
106 vol.Required(CONF_USERNAME): str,
107 vol.Required(CONF_PASSWORD): str,
111 data_schema=vol.Schema(data_schema),
116 """Check if login credentials are valid."""
117 client = aiosomecomfort.AIOSomeComfort(
118 kwargs[CONF_USERNAME],
119 kwargs[CONF_PASSWORD],
129 config_entry: ConfigEntry,
130 ) -> HoneywellOptionsFlowHandler:
131 """Options callback for Honeywell."""
136 """Config flow options for Honeywell."""
139 """Manage the options."""
140 if user_input
is not None:
145 data_schema=vol.Schema(
148 CONF_COOL_AWAY_TEMPERATURE,
150 CONF_COOL_AWAY_TEMPERATURE, DEFAULT_COOL_AWAY_TEMPERATURE
154 CONF_HEAT_AWAY_TEMPERATURE,
156 CONF_HEAT_AWAY_TEMPERATURE, DEFAULT_HEAT_AWAY_TEMPERATURE
ConfigFlowResult async_step_reauth(self, Mapping[str, Any] entry_data)
bool is_valid(self, **kwargs)
ConfigFlowResult async_step_reauth_confirm(self, dict[str, Any]|None user_input=None)
ConfigFlowResult async_step_user(self, user_input=None)
HoneywellOptionsFlowHandler async_get_options_flow(ConfigEntry config_entry)
ConfigFlowResult async_step_init(self, user_input=None)
ConfigEntry _get_reauth_entry(self)
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)
ConfigFlowResult async_update_reload_and_abort(self, ConfigEntry entry, *str|None|UndefinedType unique_id=UNDEFINED, str|UndefinedType title=UNDEFINED, Mapping[str, Any]|UndefinedType data=UNDEFINED, Mapping[str, Any]|UndefinedType data_updates=UNDEFINED, Mapping[str, Any]|UndefinedType options=UNDEFINED, str|UndefinedType reason=UNDEFINED, bool reload_even_if_entry_is_unchanged=True)
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)
ConfigEntry config_entry(self)
None config_entry(self, ConfigEntry value)
vol.Schema add_suggested_values_to_schema(self, vol.Schema data_schema, Mapping[str, Any]|None suggested_values)
_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)
aiohttp.ClientSession async_get_clientsession(HomeAssistant hass, bool verify_ssl=True, socket.AddressFamily family=socket.AF_UNSPEC, ssl_util.SSLCipherList ssl_cipher=ssl_util.SSLCipherList.PYTHON_DEFAULT)