|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Cover entity representing an IO‑Homecontrol shutter/awning/blind. More...
#include <platform_cover.h>
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. | |
| void | set_rain_sensor_poll_interval (uint32_t interval_ms) |
| Opt this cover into the periodic rain sensor poll (from YAML rain_sensor_poll_interval). | |
| void | set_sun_level_poll_interval (uint32_t interval_ms) |
| Opt this cover into the periodic sun level poll (from YAML sun_level_poll_interval). | |
| void | set_battery_level_poll_interval (uint32_t interval_ms) |
| Opt this cover into the periodic battery level poll (from YAML battery_level_poll_interval). | |
| void | set_status_refresh_interval (uint32_t interval_ms) |
| Opt this cover into the status refresh at rest (from YAML status_refresh_interval). | |
| bool | supports_intermediate_positions () const |
| Query whether this device takes intermediate positions (a slider) or only open / close / stop. | |
| 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_device_model (DeviceModel model) |
| Set the declared product model below the subtype (YAML io_model:). | |
| void | set_optimistic_state (bool optimistic_state) |
| Enable or disable optimistic target updates for this device (from YAML). | |
| void | set_travel_speed (TravelSpeed speed) |
| Set the speed profile of this device's position moves (from YAML travel_speed: or silent:). | |
| 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 | 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, DeviceCapabilityClass entity_class, std::optional< bool > invert_override, std::function< void(const std::string &, const IoDevice &)> on_update, bool dimmable=false) |
| Perform the shared setup() registration ritual. | |
| DeviceFeatures | device_features_ (DeviceCapabilityClass entity_class) const |
| What this entity's device can do: the registered device's features, or, before it is registered, the features its declared kind resolves to. | |
| 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} |
| uint32_t | rain_sensor_poll_interval_ms_ {0} |
| 0 = not opted in; no rain poll is scheduled. | |
| uint32_t | sun_level_poll_interval_ms_ {0} |
| 0 = not opted in; no sun level poll is scheduled. | |
| uint32_t | battery_level_poll_interval_ms_ {0} |
| 0 = not opted in; no battery level poll is scheduled. | |
| uint32_t | status_refresh_interval_ms_ {0} |
| 0 = not opted in; no status refresh is scheduled. | |
| Protected Attributes inherited from esphome::home_io_control::DeviceBoundEntity | |
| IOHomeControlComponent * | parent_ {nullptr} |
| std::string | device_id_ |
| DeviceType | device_type_ {DeviceType::UNKNOWN} |
| uint8_t | subtype_ {0} |
| DeviceModel | model_ {DeviceModel::NONE} |
| uint32_t | status_poll_interval_ms_ {0} |
| bool | optimistic_state_ {true} |
| TravelSpeed | travel_speed_ {TravelSpeed::FAST} |
| bool | low_power_ {false} |
| bool | battery_entities_ {false} |
| bool | has_system_key_ {false} |
| uint8_t | system_key_ [AES_KEY_SIZE] {} |
| Key material: never logged. | |
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.
|
default |
|
overrideprotected |
Handle cover commands from Home Assistant (open/close/stop/set_position).
| call | CoverCall containing the requested operation. |
Definition at line 127 of file platform_cover.cpp.
|
override |
Dump configuration to log.
Definition at line 258 of file platform_cover.cpp.
|
nodiscardprotected |
Resolve the current inversion mode.
Definition at line 114 of file platform_cover.cpp.
|
inlinenodiscardoverride |
Get setup priority (DATA so we have device registry available).
Definition at line 42 of file platform_cover.h.
|
override |
Return the traits object describing this cover's capabilities.
Definition at line 92 of file platform_cover.cpp.
|
nodiscardprotected |
Infer HA movement direction from successive IO positions when the protocol target is unknown.
| invert | Effective inversion mode for this device. |
| current_io_position | Latest reported IO position (0=open, 100=closed). |
Definition at line 123 of file platform_cover.cpp.
|
protected |
Callback invoked when the underlying device state changes.
| id | Device ID that updated. |
| dev | Updated IoDevice state. |
Definition at line 188 of file platform_cover.cpp.
|
inline |
Opt this cover into the periodic battery level poll (from YAML battery_level_poll_interval).
| interval_ms | Poll interval in milliseconds; 0 = not opted in. |
Definition at line 64 of file platform_cover.h.
|
inline |
Enable or disable position inversion.
Some devices (e.g., horizontal awnings) report reversed open/close semantics.
| invert | True to invert the mapping (HA 1.0 → IO 0, HA 0.0 → IO 100). |
Definition at line 52 of file platform_cover.h.
|
inline |
Opt this cover into the periodic rain sensor poll (from YAML rain_sensor_poll_interval).
| interval_ms | Poll interval in milliseconds; zero (the default) means no poll. |
Definition at line 58 of file platform_cover.h.
|
inline |
Opt this cover into the status refresh at rest (from YAML status_refresh_interval).
| interval_ms | Refresh interval in milliseconds; zero (the default) means no refresh. |
Definition at line 67 of file platform_cover.h.
|
inline |
Opt this cover into the periodic sun level poll (from YAML sun_level_poll_interval).
| interval_ms | Poll interval in milliseconds; 0 = not opted in. |
Definition at line 61 of file platform_cover.h.
|
override |
Initialize the cover entity (register device, subscribe to updates, schedule initial status poll).
Definition at line 75 of file platform_cover.cpp.
|
nodiscard |
Query whether this device takes intermediate positions (a slider) or only open / close / stop.
Definition at line 106 of file platform_cover.cpp.
|
nodiscard |
Query whether this device supports tilt (slat angle) control.
Definition at line 110 of file platform_cover.cpp.
|
protected |
0 = not opted in; no battery level poll is scheduled.
Definition at line 98 of file platform_cover.h.
|
protected |
Definition at line 93 of file platform_cover.h.
|
protected |
Definition at line 94 of file platform_cover.h.
|
protected |
Definition at line 95 of file platform_cover.h.
|
protected |
0 = not opted in; no rain poll is scheduled.
Definition at line 96 of file platform_cover.h.
|
protected |
0 = not opted in; no status refresh is scheduled.
Definition at line 99 of file platform_cover.h.
|
protected |
0 = not opted in; no sun level poll is scheduled.
Definition at line 97 of file platform_cover.h.