1 """Config flow for eQ-3 Bluetooth Smart thermostats."""
11 from .const
import DOMAIN
12 from .schemas
import SCHEMA_MAC
16 """Config flow for eQ-3 Bluetooth Smart thermostats."""
19 """Initialize the config flow."""
24 self, user_input: dict[str, Any] |
None =
None
25 ) -> ConfigFlowResult:
26 """Handle a flow initialized by the user."""
28 errors: dict[str, str] = {}
29 if user_input
is None:
32 data_schema=SCHEMA_MAC,
39 errors[CONF_MAC] =
"invalid_mac_address"
42 data_schema=SCHEMA_MAC,
54 self, discovery_info: BluetoothServiceInfoBleak
55 ) -> ConfigFlowResult:
56 """Handle bluetooth discovery."""
63 self.context.
update({
"title_placeholders": {CONF_MAC: self.
mac_addressmac_address}})
68 self, user_input: dict[str, Any] |
None =
None
69 ) -> ConfigFlowResult:
70 """Handle flow start."""
72 if user_input
is None:
75 description_placeholders={CONF_MAC: self.
mac_addressmac_address},
88 """Return whether or not given value is a valid MAC address."""
93 and mac.count(
":") == 5
94 and all(
int(part, 16) < 256
for part
in mac.split(
":")
if part)
ConfigFlowResult async_step_bluetooth(self, BluetoothServiceInfoBleak discovery_info)
ConfigFlowResult async_step_user(self, dict[str, Any]|None user_input=None)
ConfigFlowResult async_step_init(self, dict[str, Any]|None user_input=None)
None _abort_if_unique_id_configured(self, dict[str, Any]|None updates=None, bool reload_on_update=True, *str error="already_configured")
ConfigEntry|None async_set_unique_id(self, str|None unique_id=None, *bool raise_on_progress=True)
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_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)
bool validate_mac(str mac)
IssData update(pyiss.ISS iss)