Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
platform_cover_vent_button.h
Go to the documentation of this file.
1#pragma once
2
3/// @file platform_cover_vent_button.h
4/// @brief Generated ventilation-position button for window-type cover entities.
5/// @ingroup hioc_platforms
6///
7/// This button sends the protocol's ventilation command to window-type devices
8/// (WINDOW_OPENER, VENTILATION_POINT). The vent command moves the actuator to
9/// a predefined partially-open position suitable for air exchange.
10
11#include <string>
12
13#include "esphome/components/button/button.h"
14#include "esphome/core/component.h"
15#include "hub_core.h"
16
17namespace esphome {
18namespace home_io_control {
19
20/// @brief Button entity that sends the ventilation position command.
21///
22/// Generated automatically by the Python codegen for cover entities whose
23/// io_device_type is a window or ventilation device. Pressing this button
24/// in Home Assistant sends CoverCommand::VENT via the authenticated exchange.
25/// @ingroup hioc_platforms
26class IOHomeCoverVentButton : public button::Button, public Component {
27 public:
28 /// @brief Set the parent controller component.
29 /// @param parent Pointer to the IOHomeControlComponent instance.
30 void set_parent(IOHomeControlComponent *parent) { this->parent_ = parent; }
31
32 /// @brief Set the device ID controlled by this button.
33 /// @param id Hexadecimal node ID string (e.g. "123ABC").
34 void set_device_id(const std::string &id) { this->device_id_ = id; }
35
36 /// @brief Initialize the generated button.
37 void setup() override {}
38
39 /// @brief Dump button configuration to the log.
40 void dump_config() override;
41
42 /// @brief Get setup priority so the parent hub is available first.
43 /// @return setup_priority::DATA.
44 [[nodiscard]] float get_setup_priority() const override { return setup_priority::DATA; }
45
46 protected:
47 /// @brief Handle a Home Assistant button press by queueing a ventilation command.
48 void press_action() override;
49
51 std::string device_id_;
52};
53
54} // namespace home_io_control
55} // namespace esphome
The main IO-Homecontrol component.
Definition hub_core.h:74
Button entity that sends the ventilation position command.
void setup() override
Initialize the generated button.
void press_action() override
Handle a Home Assistant button press by queueing a ventilation command.
void set_parent(IOHomeControlComponent *parent)
Set the parent controller component.
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.
void set_device_id(const std::string &id)
Set the device ID controlled by this button.
IO-Homecontrol ESPHome component — protocol controller.