|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Functions | |
| validate_fem (config) | |
| _resolve_named_or_raw_token (token, options, max_value=0xFF) | |
| _resolve_device_type_token (token) | |
| validate_device_type (value) | |
| validate_manufacturer (value) | |
| device_type_expression (value) | |
| validate_node_id (value) | |
| validate_system_key (value) | |
| validate_device_id (value) | |
| inherit_esphome_device (companion_config, parent_config) | |
| validate_linked_remote_entry (value) | |
| validate_status_poll_interval (value) | |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
| dict | PA_PIN_OPTIONS |
| dict | RADIO_TYPE_OPTIONS |
| dict | TCXO_VOLTAGE_OPTIONS |
| FemProfile = home_io_control_ns.enum("FemProfile", is_class=True) | |
| dict | FEM_PROFILES |
| dict | FEM_REQUIRED_PINS |
| dict | FEM_TX_POWER_MAX_QUIET |
| dict | DEVICE_TYPE_OPTIONS |
| dict | MANUFACTURER_OPTIONS |
| dict | ONEWAY_WIRE_PROFILE_MANUFACTURERS |
|
protected |
Resolve a lowercase, stripped device-type token (name or raw int/hex string) to 0-255. Single source of truth for the "named value from DEVICE_TYPE_OPTIONS, else raw integer" acceptance rule shared by validate_device_type() (io_device_type) and validate_linked_remote_entry() (the class:<device_type> linked-remotes form) — both accept the exact same set of device-type spellings, so the lookup lives here once. @raises ValueError if token is neither a known name nor a parseable integer. @raises cv.Invalid if token parses as an integer but is out of range 0-255.
Definition at line 222 of file hub_validators.py.
|
protected |
Resolve a lowercase, stripped token (a name from `options`, or a raw int/hex string) to an integer 0-`max_value`. Shared "named value, else raw integer" acceptance rule: validate_device_type()/ validate_linked_remote_entry() (DEVICE_TYPE_OPTIONS) and validate_manufacturer() (MANUFACTURER_OPTIONS) are the same shape of small, protocol-defined enum with an escape hatch for values this project hasn't named yet, so the lookup lives here once. @raises ValueError if token is neither a known name nor a parseable integer. @raises cv.Invalid if token parses as an integer but is out of range.
Definition at line 206 of file hub_validators.py.
| device_type_expression | ( | value | ) |
Generate a C++ static_cast expression for a validated device type.
Definition at line 276 of file hub_validators.py.
| inherit_esphome_device | ( | companion_config, | |
| parent_config ) |
Propagate the parent entity's ESPHome sub-device (YAML `device_id:`) onto a hand-built companion config dict, so the companion entity groups under the same HA device as its parent. Lives here rather than in platform_common.py: it is needed by button.py's pairing-result sensor, which is not a device-bound platform and would otherwise have to import the whole platform-schema module for a four-line helper. platform_common.py re-exports it so cover.py's existing import keeps working. Companion entities (diagnostic sensors, cover favorite/vent buttons, ...) are built from dicts fed straight to e.g. new_text_sensor()/new_button() rather than through the platform's own cv.Schema(), so they never go through ENTITY_BASE_SCHEMA and never pick up `device_id:` on their own. esphome.core.entity_helpers.setup_entity() reads it with `config.get(CONF_DEVICE_ID)`, a truthiness check, so an explicit `None` and an absent key behave identically; omitted here rather than set to None just to keep the dict shape identical to a companion with no sub-device at all. Deliberately not called anywhere for the hub-level dynamic entities (1W identity buttons/ sensors, the arming switches, LR1121 firmware controls, tuning numbers/selects): none of their parent configs carry a `device_id:` schema slot, since those entities aren't attached to a single cover/light/switch/lock to inherit one from. `device_id:` grouping is scoped to the four device-bound platforms; hub-level entities always live on ESPHome's main device.
Definition at line 319 of file hub_validators.py.
| validate_device_id | ( | value | ) |
Validate io_device_id as exactly 6 hex characters (3 bytes).
Definition at line 307 of file hub_validators.py.
| validate_device_type | ( | value | ) |
Validate io_device_type as a named string or integer 0-255.
Definition at line 235 of file hub_validators.py.
| validate_fem | ( | config | ) |
Cross-key validation for `fem:` (ADR 0035): which front-end part's control behaviour the SX1262 driver applies to fem_pa_pin (and, for the two parts that have one, fem_en_pin), never which GPIO numbers to use for them -- those are always the board package's job, the same as every other radio pin. Requires radio_type: sx1262 (the raw FEM pins are silently ignored on every other chip -- select_and_construct_radio_() only ever hands them to RadioSX1262 -- so a mismatched radio_type would configure hardware the driver never drives), and that every pin this profile's behaviour needs is actually present, naming exactly which is missing rather than leaving the driver to silently no-op on a null pin. Also warns when tx_power looks likely to push this FEM's antenna-port power over a typical 868 MHz SRD limit -- radio_sx1262.cpp's own init() logs the actual per-part estimate this warning can only gesture at without knowing the front-end part's exact gain table here too.
Definition at line 106 of file hub_validators.py.
| validate_linked_remote_entry | ( | value | ) |
Validate a linked_remotes entry: either a device ID or 'class:<device_type>'. The class form matches how 1W remotes address a typed broadcast (e.g. "all awnings") rather than a single node, so one entry can cover many same-type devices without enumerating each one. Shares _resolve_device_type_token() with validate_device_type() so a type without a named YAML alias yet (e.g. discovered via pairing) can still be class-linked. Normalized to 'class:0x<HH>' (uppercase hex) so wire_device_binding() can parse the type directly without a second DEVICE_TYPE_OPTIONS lookup; bare device IDs are validated exactly as before and behave identically.
Definition at line 347 of file hub_validators.py.
| validate_manufacturer | ( | value | ) |
Validate manufacturer as a named string (MANUFACTURER_OPTIONS) or integer 0-255. Mirrors validate_device_type() exactly (same "name, else raw integer" shape via _resolve_named_or_raw_token()) — a manufacturer ID is the same kind of small, protocol-defined enum, it just has no linked_remotes-style second caller.
Definition at line 254 of file hub_validators.py.
| validate_node_id | ( | value | ) |
Validate node_id as exactly 6 hex characters (3 bytes).
Definition at line 283 of file hub_validators.py.
| validate_status_poll_interval | ( | value | ) |
Validate status_poll_interval is at least MIN_STATUS_POLL_INTERVAL_MS.
Definition at line 372 of file hub_validators.py.
| validate_system_key | ( | value | ) |
Validate system_key as exactly 32 hex characters (16 bytes).
Definition at line 295 of file hub_validators.py.
|
protected |
Definition at line 31 of file hub_validators.py.
| dict home_io_control.hub_validators.DEVICE_TYPE_OPTIONS |
Definition at line 152 of file hub_validators.py.
| dict home_io_control.hub_validators.FEM_PROFILES |
Definition at line 71 of file hub_validators.py.
| dict home_io_control.hub_validators.FEM_REQUIRED_PINS |
Definition at line 86 of file hub_validators.py.
| dict home_io_control.hub_validators.FEM_TX_POWER_MAX_QUIET |
Definition at line 99 of file hub_validators.py.
| home_io_control.hub_validators.FemProfile = home_io_control_ns.enum("FemProfile", is_class=True) |
Definition at line 70 of file hub_validators.py.
| dict home_io_control.hub_validators.MANUFACTURER_OPTIONS |
Definition at line 182 of file hub_validators.py.
| dict home_io_control.hub_validators.ONEWAY_WIRE_PROFILE_MANUFACTURERS |
Definition at line 200 of file hub_validators.py.
| dict home_io_control.hub_validators.PA_PIN_OPTIONS |
Definition at line 34 of file hub_validators.py.
| dict home_io_control.hub_validators.RADIO_TYPE_OPTIONS |
Definition at line 39 of file hub_validators.py.
| dict home_io_control.hub_validators.TCXO_VOLTAGE_OPTIONS |
Definition at line 50 of file hub_validators.py.