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

Cover entity representing an IO‑Homecontrol shutter/awning/blind. More...

#include <platform_cover.h>

Inheritance diagram for esphome::home_io_control::IOHomeCover:
Collaboration diagram for esphome::home_io_control::IOHomeCover:

Public Member Functions

 IOHomeCover ()=default
void setup () override
 Initialize the cover entity (register device, subscribe to updates, schedule initial status poll).
void dump_config () override
 Dump configuration to log.
float get_setup_priority () const override
 Get setup priority (DATA so we have device registry available).
cover::CoverTraits get_traits () override
 Return the traits object describing this cover's capabilities.
void set_invert_position (bool invert)
 Enable or disable position inversion.
bool supports_tilt () const
 Query whether this device supports tilt (slat angle) control.
Public Member Functions inherited from esphome::home_io_control::DeviceBoundEntity
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 control (const cover::CoverCall &call) override
 Handle cover commands from Home Assistant (open/close/stop/set_position).
void on_device_update_ (const std::string &id, const IoDevice &dev)
 Callback invoked when the underlying device state changes.
bool effective_invert_ () const
 Resolve the current inversion mode.
cover::CoverOperation infer_operation_from_position_delta_ (bool invert, float current_io_position) const
 Infer HA movement direction from successive IO positions when the protocol target is unknown.
Protected Member Functions inherited from esphome::home_io_control::DeviceBoundEntity
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

bool invert_ {false}
bool invert_explicit_ {false}
float last_io_position_ {UNKNOWN_POSITION}
Protected Attributes inherited from esphome::home_io_control::DeviceBoundEntity
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

Cover entity representing an IO‑Homecontrol shutter/awning/blind.

The device-binding setters, setup() registration ritual and poll-interval dump line come from DeviceBoundEntity; the richer position/tilt/movement mapping and the invert option stay here.

Definition at line 33 of file platform_cover.h.

Constructor & Destructor Documentation

◆ IOHomeCover()

esphome::home_io_control::IOHomeCover::IOHomeCover ( )
default

Member Function Documentation

◆ control()

void esphome::home_io_control::IOHomeCover::control ( const cover::CoverCall & call)
overrideprotected

Handle cover commands from Home Assistant (open/close/stop/set_position).

Parameters
callCoverCall containing the requested operation.
Todo
Monitor https://github.com/home-assistant/core/issues/174533 — if HA adds a combined cover.set_cover_position_and_tilt action, this branch would be exercised directly from a single CoverCall. The queue coalescing in queue_set_device_position/tilt remains a useful optimization for the two-separate-calls path regardless.

Definition at line 59 of file platform_cover.cpp.

Here is the call graph for this function:

◆ dump_config()

void esphome::home_io_control::IOHomeCover::dump_config ( )
override

Dump configuration to log.

Definition at line 168 of file platform_cover.cpp.

Here is the call graph for this function:

◆ effective_invert_()

bool esphome::home_io_control::IOHomeCover::effective_invert_ ( ) const
nodiscardprotected

Resolve the current inversion mode.

Returns
Explicit YAML override when set, otherwise the runtime device profile.

Definition at line 35 of file platform_cover.cpp.

◆ get_setup_priority()

float esphome::home_io_control::IOHomeCover::get_setup_priority ( ) const
inlinenodiscardoverride

Get setup priority (DATA so we have device registry available).

Returns
setup_priority::DATA.

Definition at line 42 of file platform_cover.h.

◆ get_traits()

cover::CoverTraits esphome::home_io_control::IOHomeCover::get_traits ( )
override

Return the traits object describing this cover's capabilities.

Returns
CoverTraits configured for position, stop, and optional tilt.

Definition at line 22 of file platform_cover.cpp.

Here is the call graph for this function:

◆ infer_operation_from_position_delta_()

cover::CoverOperation esphome::home_io_control::IOHomeCover::infer_operation_from_position_delta_ ( bool invert,
float current_io_position ) const
nodiscardprotected

Infer HA movement direction from successive IO positions when the protocol target is unknown.

Parameters
invertEffective inversion mode for this device.
current_io_positionLatest reported IO position (0=open, 100=closed).
Returns
OPENING, CLOSING, or IDLE when no direction can be inferred yet.

Definition at line 44 of file platform_cover.cpp.

◆ on_device_update_()

void esphome::home_io_control::IOHomeCover::on_device_update_ ( const std::string & id,
const IoDevice & dev )
protected

Callback invoked when the underlying device state changes.

Parameters
idDevice ID that updated.
devUpdated IoDevice state.

Definition at line 119 of file platform_cover.cpp.

Here is the call graph for this function:

◆ set_invert_position()

void esphome::home_io_control::IOHomeCover::set_invert_position ( bool invert)
inline

Enable or disable position inversion.

Some devices (e.g., horizontal awnings) report reversed open/close semantics.

Parameters
invertTrue to invert the mapping (HA 1.0 → IO 0, HA 0.0 → IO 100).

Definition at line 51 of file platform_cover.h.

◆ setup()

void esphome::home_io_control::IOHomeCover::setup ( )
override

Initialize the cover entity (register device, subscribe to updates, schedule initial status poll).

Definition at line 14 of file platform_cover.cpp.

Here is the call graph for this function:

◆ supports_tilt()

bool esphome::home_io_control::IOHomeCover::supports_tilt ( ) const
nodiscard

Query whether this device supports tilt (slat angle) control.

Returns
true if the YAML‑declared device type is tilt‑capable.

Definition at line 31 of file platform_cover.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ invert_

bool esphome::home_io_control::IOHomeCover::invert_ {false}
protected

Definition at line 77 of file platform_cover.h.

◆ invert_explicit_

bool esphome::home_io_control::IOHomeCover::invert_explicit_ {false}
protected

Definition at line 78 of file platform_cover.h.

◆ last_io_position_

float esphome::home_io_control::IOHomeCover::last_io_position_ {UNKNOWN_POSITION}
protected

Definition at line 79 of file platform_cover.h.


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