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