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
17
namespace
esphome
{
18
namespace
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
26
class
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
50
IOHomeControlComponent
*
parent_
{
nullptr
};
51
std::string
device_id_
;
52
};
53
54
}
// namespace home_io_control
55
}
// namespace esphome
esphome::home_io_control::IOHomeControlComponent
The main IO-Homecontrol component.
Definition
hub_core.h:74
esphome::home_io_control::IOHomeCoverVentButton
Button entity that sends the ventilation position command.
Definition
platform_cover_vent_button.h:26
esphome::home_io_control::IOHomeCoverVentButton::parent_
IOHomeControlComponent * parent_
Definition
platform_cover_vent_button.h:50
esphome::home_io_control::IOHomeCoverVentButton::setup
void setup() override
Initialize the generated button.
Definition
platform_cover_vent_button.h:37
esphome::home_io_control::IOHomeCoverVentButton::press_action
void press_action() override
Handle a Home Assistant button press by queueing a ventilation command.
Definition
platform_cover_vent_button.cpp:14
esphome::home_io_control::IOHomeCoverVentButton::device_id_
std::string device_id_
Definition
platform_cover_vent_button.h:51
esphome::home_io_control::IOHomeCoverVentButton::set_parent
void set_parent(IOHomeControlComponent *parent)
Set the parent controller component.
Definition
platform_cover_vent_button.h:30
esphome::home_io_control::IOHomeCoverVentButton::dump_config
void dump_config() override
Dump button configuration to the log.
Definition
platform_cover_vent_button.cpp:29
esphome::home_io_control::IOHomeCoverVentButton::get_setup_priority
float get_setup_priority() const override
Get setup priority so the parent hub is available first.
Definition
platform_cover_vent_button.h:44
esphome::home_io_control::IOHomeCoverVentButton::set_device_id
void set_device_id(const std::string &id)
Set the device ID controlled by this button.
Definition
platform_cover_vent_button.h:34
hub_core.h
IO-Homecontrol ESPHome component — protocol controller.
esphome::home_io_control
Definition
device_registry.cpp:13
esphome
Definition
device_registry.cpp:12
components
home_io_control
platform_cover_vent_button.h
Generated by
1.16.1