ESPHome
2025.11.0b4
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
{
10
namespace
uart {
11
12
class
UARTButton
:
public
button::Button
,
public
UARTDevice
,
public
Component
{
13
public
:
14
void
set_data
(std::vector<uint8_t> &&data) { this->
data_
= std::move(data); }
15
void
set_data
(std::initializer_list<uint8_t> data) { this->
data_
= std::vector<uint8_t>(data); }
16
17
void
dump_config
()
override
;
18
19
protected
:
20
void
press_action
()
override
;
21
std::vector<uint8_t>
data_
;
22
};
23
24
}
// namespace uart
25
}
// namespace esphome
button.h
esphome::Component
Definition
component.h:74
esphome::button::Button
Base class for all buttons.
Definition
button.h:26
esphome::uart::UARTButton
Definition
uart_button.h:12
esphome::uart::UARTButton::set_data
void set_data(std::initializer_list< uint8_t > data)
Definition
uart_button.h:15
esphome::uart::UARTButton::data_
std::vector< uint8_t > data_
Definition
uart_button.h:21
esphome::uart::UARTButton::press_action
void press_action() override
Definition
uart_button.cpp:9
esphome::uart::UARTButton::dump_config
void dump_config() override
Definition
uart_button.cpp:14
esphome::uart::UARTButton::set_data
void set_data(std::vector< uint8_t > &&data)
Definition
uart_button.h:14
esphome::uart::UARTDevice
Definition
uart.h:12
component.h
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
uart.h
Generated by
1.12.0