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
IOHomeControlComponent * parent_ {nullptr}
std::string device_id_

Detailed Description

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

One class covers every companion the cover platform generates from NAMED_POSITIONS: codegen calls set_command() with CoverCommand::FAVORITE for the favorite/"My"-position button (position-capable device types), 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), CoverCommand::PARTIAL for the Partial Position button (garage openers) and CoverCommand::PEDESTRIAN for the Pedestrian Position button (gate openers). The press path, the parent/device guards and the log wording are identical for all of them; only the command byte differs.

Todo
Confirm on a real gate opener that PEDESTRIAN (0xD807) moves the motor to that position (experimental; the button is disabled by default). PARTIAL (0xD809) runs a garage opener's stored partial position (issue #163).

Definition at line 45 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 42 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 61 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 26 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, CoverCommand::PARTIAL for the partial companion, CoverCommand::PEDESTRIAN for the experimental pedestrian companion.

Definition at line 51 of file platform_cover_controls.h.

◆ setup()

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

Initialize the generated button.

Definition at line 54 of file platform_cover_controls.h.

Member Data Documentation

◆ command_

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

Definition at line 68 of file platform_cover_controls.h.


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