|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Functions | |
| _inject_pairing_result_sensor_id (config) | |
| _warn_deprecated_platform (config) | |
| _reject_duplicate_with_hub_flag (config) | |
| to_code (config) | |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
| list | DEPENDENCIES = ["home_io_control"] |
| str | CONF_PAIRING_RESULT_SENSOR_ID = "_pairing_result_sensor_id" |
| CONFIG_SCHEMA | |
| FINAL_VALIDATE_SCHEMA = _reject_duplicate_with_hub_flag | |
|
protected |
Declare the companion pairing-result sensor ID during schema validation. ESPHome 2026.x sizes its runtime component vector from the number of component IDs known at the end of schema validation — before to_code() runs. A companion entity created only in to_code() is not counted and silently drops at runtime. See the identical pattern (and its full rationale) in platform_common.py::companion_id_base().
|
protected |
Reject having both this legacy entry and the hub's own discover_and_pair_button: true. Rejected unconditionally, regardless of this entry's own name/device_id -- by default both create a button named "Discover & Pair" on the same device, which ESPHome's entity-duplicate validator refuses, but it only notices inside the hub's to_code(), where the resulting cv.Invalid surfaces as an uncaught traceback rather than a validation message. A renamed or re-homed entry could in principle coexist without colliding, but forcing the choice here keeps the guard simple and the migration unambiguous: one pairing trigger, not "two unless you were careful". Platform modules get their own FINAL_VALIDATE_SCHEMA slot, so this does not touch __init__.py's (already used for address-collision detection).
|
protected |
Warn that this platform is superseded by home_io_control.discover_and_pair_button. Placed FIRST in CONFIG_SCHEMA's cv.All() chain so the warning still reaches a user whose entry also has an unrelated validation error. ESPHome runs each entry's schema exactly once per `esphome config|compile|run`, so this fires once per legacy entry per invocation -- no dedupe flag needed. A validator rather than to_code()'s first line (ESPHome's own precedent for a whole-component deprecation) so `esphome config` and the dashboard's validate-only pass show it too, and to match this component's existing convention of warning from validators.
|
protected |
| str home_io_control.button.CONF_PAIRING_RESULT_SENSOR_ID = "_pairing_result_sensor_id" |
| home_io_control.button.CONFIG_SCHEMA |
| list home_io_control.button.DEPENDENCIES = ["home_io_control"] |
| home_io_control.button.FINAL_VALIDATE_SCHEMA = _reject_duplicate_with_hub_flag |