Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
esphome::home_io_control::DeviceBoundEntity Class Reference

Mixin holding the hub-device binding shared by all IO-Homecontrol entity platforms. More...

#include <platform_entity_base.h>

Inheritance diagram for esphome::home_io_control::DeviceBoundEntity:
Collaboration diagram for esphome::home_io_control::DeviceBoundEntity:

Public Member Functions

void set_parent (IOHomeControlComponent *parent)
 Set the parent controller component.
void set_device_id (const std::string &id)
 Set the unique IO-homecontrol device ID (from YAML).
void set_device_type (DeviceType type)
 Set the declared device type (from YAML).
void set_subtype (uint8_t subtype)
 Set the declared device subtype (from YAML).
void set_optimistic_state (bool optimistic_state)
 Enable or disable optimistic target updates for this device (from YAML).
void set_silent (bool silent)
 Send this device's position moves in "silent operation" mode — the reference hub's slower travel profile.
void set_low_power (bool low_power)
 Mark this device as a low-power / duty-cycled receiver.
void set_system_key (const std::string &key)
 Give this device a system key of its own (system_key: in YAML).
void set_battery_entities (bool battery_entities)
 Record that the YAML declared battery: true, so the status log line names the battery level even when the device reports none.
void set_status_poll_interval (uint32_t poll_interval_ms)
 Configure bounded follow-up polling while a state change is expected.

Protected Member Functions

void register_device_binding_ (Component *self, bool inverted, std::function< void(const std::string &, const IoDevice &)> on_update)
 Perform the shared setup() registration ritual.
bool passes_binary_update_filter_ (const std::string &id, const IoDevice &dev) const
 Shared inbound-update guard for binary endpoints.
void log_poll_interval_config_ (const char *tag) const
 Emit the shared two-branch poll-interval line for dump_config().

Protected Attributes

IOHomeControlComponent * parent_ {nullptr}
std::string device_id_
DeviceType device_type_ {DeviceType::UNKNOWN}
uint8_t subtype_ {0}
uint32_t status_poll_interval_ms_ {0}
bool optimistic_state_ {true}
bool silent_ {false}
bool low_power_ {false}
bool battery_entities_ {false}
bool has_system_key_ {false}
uint8_t system_key_ [AES_KEY_SIZE] {}
 Key material: never logged.

Detailed Description

Mixin holding the hub-device binding shared by all IO-Homecontrol entity platforms.

Definition at line 38 of file platform_entity_base.h.

Member Function Documentation

◆ log_poll_interval_config_()

void esphome::home_io_control::DeviceBoundEntity::log_poll_interval_config_ ( const char * tag) const
inlineprotected

Emit the shared two-branch poll-interval line for dump_config().

Parameters
tagLog tag of the calling entity.

Definition at line 117 of file platform_entity_base.h.

◆ passes_binary_update_filter_()

bool esphome::home_io_control::DeviceBoundEntity::passes_binary_update_filter_ ( const std::string & id,
const IoDevice & dev ) const
inlinenodiscardprotected

Shared inbound-update guard for binary endpoints.

Matches this device and accepts only a settled (stopped) status with a known position. Covers and locks intentionally use their own richer guards instead of this filter.

Definition at line 111 of file platform_entity_base.h.

Here is the call graph for this function:

◆ register_device_binding_()

void esphome::home_io_control::DeviceBoundEntity::register_device_binding_ ( Component * self,
bool inverted,
std::function< void(const std::string &, const IoDevice &)> on_update )
inlineprotected

Perform the shared setup() registration ritual.

Registers the device with the controller, sets its status-poll interval, subscribes the entity's update callback, and schedules the delayed initial status request — in the exact order every entity used before.

Parameters
selfThe entity itself; used for set_timeout(), since DeviceBoundEntity is not a Component.
invertedInitial inversion flag passed to add_device (covers compute it; others pass false).
on_updateThe entity's device-update callback.

Definition at line 90 of file platform_entity_base.h.

Here is the call graph for this function:

◆ set_battery_entities()

void esphome::home_io_control::DeviceBoundEntity::set_battery_entities ( bool battery_entities)
inline

Record that the YAML declared battery: true, so the status log line names the battery level even when the device reports none.

Cover-only in practice.

Definition at line 76 of file platform_entity_base.h.

◆ set_device_id()

void esphome::home_io_control::DeviceBoundEntity::set_device_id ( const std::string & id)
inline

Set the unique IO-homecontrol device ID (from YAML).

Parameters
idHexadecimal node ID string (e.g., "123ABC").

Definition at line 45 of file platform_entity_base.h.

◆ set_device_type()

void esphome::home_io_control::DeviceBoundEntity::set_device_type ( DeviceType type)
inline

Set the declared device type (from YAML).

Parameters
typeDevice type enum.

Definition at line 48 of file platform_entity_base.h.

◆ set_low_power()

void esphome::home_io_control::DeviceBoundEntity::set_low_power ( bool low_power)
inline

Mark this device as a low-power / duty-cycled receiver.

Directed frames to it then set CTRL1_LOW_POWER and use the long wake-up preamble; an always-alive device (the default) gets neither. Radio property of the device, shared by all four platforms.

Parameters
low_powerTrue for a battery/solar or otherwise sleeping receiver; default false.

Definition at line 65 of file platform_entity_base.h.

◆ set_optimistic_state()

void esphome::home_io_control::DeviceBoundEntity::set_optimistic_state ( bool optimistic_state)
inline

Enable or disable optimistic target updates for this device (from YAML).

Only covers expose this in YAML today; other platforms keep the default (true), which is inert for entity types that never consult the effective target / movement state.

Parameters
optimistic_stateFalse to disable optimistic state; default true.

Definition at line 56 of file platform_entity_base.h.

◆ set_parent()

void esphome::home_io_control::DeviceBoundEntity::set_parent ( IOHomeControlComponent * parent)
inline

Set the parent controller component.

Parameters
parentPointer to the IOHomeControlComponent instance.

Definition at line 42 of file platform_entity_base.h.

◆ set_silent()

void esphome::home_io_control::DeviceBoundEntity::set_silent ( bool silent)
inline

Send this device's position moves in "silent operation" mode — the reference hub's slower travel profile.

Cover-only in practice; harmless on other platforms, which never issue position moves.

Definition at line 60 of file platform_entity_base.h.

◆ set_status_poll_interval()

void esphome::home_io_control::DeviceBoundEntity::set_status_poll_interval ( uint32_t poll_interval_ms)
inline

Configure bounded follow-up polling while a state change is expected.

Parameters
poll_interval_msPoll interval in milliseconds; zero keeps the default single settle poll only.

Definition at line 79 of file platform_entity_base.h.

◆ set_subtype()

void esphome::home_io_control::DeviceBoundEntity::set_subtype ( uint8_t subtype)
inline

Set the declared device subtype (from YAML).

Parameters
subtypeSubtype value.

Definition at line 51 of file platform_entity_base.h.

◆ set_system_key()

void esphome::home_io_control::DeviceBoundEntity::set_system_key ( const std::string & key)
inline

Give this device a system key of its own (system_key: in YAML).

Every exchange with the device then uses this key instead of the hub's. The key is validated as 32 hex characters at config time, so a parse failure here leaves the device on the hub key.

Parameters
key32 hex characters.

Definition at line 71 of file platform_entity_base.h.

Here is the call graph for this function:

Member Data Documentation

◆ battery_entities_

bool esphome::home_io_control::DeviceBoundEntity::battery_entities_ {false}
protected

Definition at line 133 of file platform_entity_base.h.

◆ device_id_

std::string esphome::home_io_control::DeviceBoundEntity::device_id_
protected

Definition at line 126 of file platform_entity_base.h.

◆ device_type_

DeviceType esphome::home_io_control::DeviceBoundEntity::device_type_ {DeviceType::UNKNOWN}
protected

Definition at line 127 of file platform_entity_base.h.

◆ has_system_key_

bool esphome::home_io_control::DeviceBoundEntity::has_system_key_ {false}
protected

Definition at line 134 of file platform_entity_base.h.

◆ low_power_

bool esphome::home_io_control::DeviceBoundEntity::low_power_ {false}
protected

Definition at line 132 of file platform_entity_base.h.

◆ optimistic_state_

bool esphome::home_io_control::DeviceBoundEntity::optimistic_state_ {true}
protected

Definition at line 130 of file platform_entity_base.h.

◆ parent_

IOHomeControlComponent* esphome::home_io_control::DeviceBoundEntity::parent_ {nullptr}
protected

Definition at line 125 of file platform_entity_base.h.

◆ silent_

bool esphome::home_io_control::DeviceBoundEntity::silent_ {false}
protected

Definition at line 131 of file platform_entity_base.h.

◆ status_poll_interval_ms_

uint32_t esphome::home_io_control::DeviceBoundEntity::status_poll_interval_ms_ {0}
protected

Definition at line 129 of file platform_entity_base.h.

◆ subtype_

uint8_t esphome::home_io_control::DeviceBoundEntity::subtype_ {0}
protected

Definition at line 128 of file platform_entity_base.h.

◆ system_key_

uint8_t esphome::home_io_control::DeviceBoundEntity::system_key_[AES_KEY_SIZE] {}
protected

Key material: never logged.

Definition at line 135 of file platform_entity_base.h.


The documentation for this class was generated from the following file: