ESPHome
2025.12.2
Loading...
Searching...
No Matches
esphome
components
uart
button
uart_button.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/uart/uart.h
"
5
#include "
esphome/components/button/button.h
"
6
7
#include <vector>
8
9
namespace
esphome::uart
{
10
11
class
UARTButton
:
public
button::Button
,
public
UARTDevice
,
public
Component
{
12
public
:
13
void
set_data
(std::vector<uint8_t> &&data) { this->
data_
= std::move(data); }
14
void
set_data
(std::initializer_list<uint8_t> data) { this->
data_
= std::vector<uint8_t>(data); }
15
16
void
dump_config
()
override
;
17
18
protected
:
19
void
press_action
()
override
;
20
std::vector<uint8_t>
data_
;
21
};
22
23
}
// namespace esphome::uart
button.h
esphome::Component
Definition
component.h:75
esphome::button::Button
Base class for all buttons.
Definition
button.h:25
esphome::uart::UARTButton
Definition
uart_button.h:11
esphome::uart::UARTButton::set_data
void set_data(std::initializer_list< uint8_t > data)
Definition
uart_button.h:14
esphome::uart::UARTButton::data_
std::vector< uint8_t > data_
Definition
uart_button.h:20
esphome::uart::UARTButton::press_action
void press_action() override
Definition
uart_button.cpp:8
esphome::uart::UARTButton::dump_config
void dump_config() override
Definition
uart_button.cpp:13
esphome::uart::UARTButton::set_data
void set_data(std::vector< uint8_t > &&data)
Definition
uart_button.h:13
esphome::uart::UARTDevice
Definition
uart.h:11
component.h
esphome::uart
Definition
automation.h:8
uart.h
Generated by
1.12.0