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_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

IOHomeControlComponentparent_ {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}

Detailed Description

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

Definition at line 33 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 88 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 82 of file platform_entity_base.h.

◆ 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 65 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 40 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 43 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 read IoDevice.target/is_stopped.

Parameters
optimistic_stateFalse to disable optimistic state; default true.

Definition at line 51 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 37 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 54 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 46 of file platform_entity_base.h.

Member Data Documentation

◆ device_id_

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

Definition at line 97 of file platform_entity_base.h.

◆ device_type_

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

Definition at line 98 of file platform_entity_base.h.

◆ optimistic_state_

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

Definition at line 101 of file platform_entity_base.h.

◆ parent_

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

Definition at line 96 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 100 of file platform_entity_base.h.

◆ subtype_

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

Definition at line 99 of file platform_entity_base.h.


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