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

Button entity that sends one non-positional cover command on press. More...

#include <platform_cover_controls.h>

Inheritance diagram for esphome::home_io_control::IOHomeCoverCommandButton:
Collaboration diagram for esphome::home_io_control::IOHomeCoverCommandButton:

Public Member Functions

void set_command (CoverCommand command)
 Set which cover command a press sends.
void setup () override
 Initialize the generated button.
void dump_config () override
 Dump button configuration to the log.
float get_setup_priority () const override
 Get setup priority so the parent hub is available first.
Public Member Functions inherited from esphome::home_io_control::DeviceBoundCompanion
void set_parent (IOHomeControlComponent *parent)
 Set the parent controller component.
void set_device_id (const std::string &id)
 Set the device ID whose state this companion sensor exposes.

Protected Member Functions

void press_action () override
 Handle a Home Assistant button press by queueing this button's cover command, which is then sent to the device via the authenticated exchange like any other cover command.
Protected Member Functions inherited from esphome::home_io_control::DeviceBoundCompanion
void register_companion_binding_ (const std::function< void(const IoDevice &)> &publish)
 Shared setup() body: subscribe to this device's updates and publish the initial state.

Protected Attributes

CoverCommand command_ {CoverCommand::FAVORITE}
Protected Attributes inherited from esphome::home_io_control::DeviceBoundCompanion
IOHomeControlComponentparent_ {nullptr}
std::string device_id_

Detailed Description

Button entity that sends one non-positional cover command on press.

One class covers both companions the cover platform generates: codegen calls set_command() with CoverCommand::FAVORITE for the favorite/"My"-position button (position-capable device types) and CoverCommand::VENT for the ventilation button (window-type devices — WINDOW_OPENER, VENTILATION_POINT — where the vent command moves the actuator to a predefined partially-open position suitable for air exchange). The press path, the parent/device guards and the log wording are identical for both; only the command byte differs.

Definition at line 34 of file platform_cover_controls.h.

Member Function Documentation

◆ dump_config()

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

Dump button configuration to the log.

Definition at line 34 of file platform_cover_controls.cpp.

Here is the call graph for this function:

◆ get_setup_priority()

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

Get setup priority so the parent hub is available first.

Returns
setup_priority::DATA.

Definition at line 49 of file platform_cover_controls.h.

◆ press_action()

void esphome::home_io_control::IOHomeCoverCommandButton::press_action ( )
overrideprotected

Handle a Home Assistant button press by queueing this button's cover command, which is then sent to the device via the authenticated exchange like any other cover command.

Definition at line 18 of file platform_cover_controls.cpp.

Here is the call graph for this function:

◆ set_command()

void esphome::home_io_control::IOHomeCoverCommandButton::set_command ( CoverCommand command)
inline

Set which cover command a press sends.

Parameters
commandCoverCommand::FAVORITE for the favorite-position companion, CoverCommand::VENT for the ventilation companion.

Definition at line 39 of file platform_cover_controls.h.

◆ setup()

void esphome::home_io_control::IOHomeCoverCommandButton::setup ( )
inlineoverride

Initialize the generated button.

Definition at line 42 of file platform_cover_controls.h.

Member Data Documentation

◆ command_

CoverCommand esphome::home_io_control::IOHomeCoverCommandButton::command_ {CoverCommand::FAVORITE}
protected

Definition at line 56 of file platform_cover_controls.h.


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