|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Functions | |
| _inject_hub_entity_id (config, *, flag_key, id_key, suffix, cls) | |
| inject_accept_foreign_pairing_switch_id (config) | |
| inject_recover_oneway_key_switch_id (config) | |
| inject_scan_paired_devices_button_id (config) | |
| inject_discover_and_pair_button_id (config) | |
| inject_discover_and_pair_result_sensor_id (config) | |
| _create_hub_entity (schema, new_entity, entity_id, name, var) | |
| create_hub_arming_switch (config, var, *, cls, id_key, name) | |
| create_scan_paired_devices_button (config, var) | |
| create_discover_and_pair_button (config, var) | |
|
protected |
Create one hub-level entity from its declared ID and a fixed name, bound to the hub.
A bare {id, name} dict is run through the platform's entity schema plus COMPONENT_SCHEMA, so
it carries the entity/component defaults new_*()/register_component() require, instead of a
hand-assembled config dict of its own (tuning.py's _create_number()/_create_select() do the
same for the tuning entities).
Definition at line 112 of file hub_entities.py.
|
protected |
Shared body for the hub-level entities gated by a bare boolean flag in the
`home_io_control:` block (accept_foreign_pairing, recover_oneway_key,
scan_paired_devices_button, discover_and_pair_button): declare the entity's ID during
validation, under the `{hub_id}_{suffix}` name, only when its flag is set. See
companion_id_base() in platform_common.py for why this must happen at validation time rather
than in to_code().
Definition at line 42 of file hub_entities.py.
| create_discover_and_pair_button | ( | config, | |
| var ) |
Create the hub-level "Discover & Pair" button and its "Last Pairing Result" sensor. The two are always created together: the sensor is the only place a pairing attempt's machine-readable outcome ever appears, so a button without it would be a button whose result you cannot read. inherit_esphome_device() is deliberately NOT called: the hub's own config has no `device_id:` slot for these to inherit -- see that function's docstring. This is the one behaviour the deprecated `button:` platform (button.py) had that this flag form cannot reproduce.
Definition at line 154 of file hub_entities.py.
| create_hub_arming_switch | ( | config, | |
| var, | |||
| * | , | ||
| cls, | |||
| id_key, | |||
| name ) |
Create a hub-level arming switch (key extraction or key adoption). ALWAYS_OFF is a security property, not a UX default: every switch built here arms a window (foreign-key extraction or 1W key adoption) that must never come back armed after a reboot.
Definition at line 127 of file hub_entities.py.
| create_scan_paired_devices_button | ( | config, | |
| var ) |
Create the hub-level "Scan Paired Devices" button. The `scan_paired_devices` native API action is registered independently in C++ (ManagementActions::register_actions()) and is unaffected by this key -- the button is an extra trigger onto the same method, not a replacement.
Definition at line 141 of file hub_entities.py.
| inject_accept_foreign_pairing_switch_id | ( | config | ) |
| inject_discover_and_pair_button_id | ( | config | ) |
| inject_discover_and_pair_result_sensor_id | ( | config | ) |
Second ID off the same flag: the button always ships with its "Last Pairing Result" sensor, so both IDs are gated on CONF_DISCOVER_AND_PAIR_BUTTON. _inject_hub_entity_id() already no-ops when the flag is false, so no extra guard is needed here.
Definition at line 98 of file hub_entities.py.
| inject_recover_oneway_key_switch_id | ( | config | ) |
| inject_scan_paired_devices_button_id | ( | config | ) |