ESPHome
2025.12.2
Loading...
Searching...
No Matches
esphome
components
uart
button
uart_button.cpp
Go to the documentation of this file.
1
#include "
uart_button.h
"
2
#include "
esphome/core/log.h
"
3
4
namespace
esphome::uart
{
5
6
static
const
char
*
const
TAG
=
"uart.button"
;
7
8
void
UARTButton::press_action
() {
9
ESP_LOGD(TAG,
"'%s': Sending data"
, this->
get_name
().c_str());
10
this->
write_array
(this->
data_
.data(), this->data_.size());
11
}
12
13
void
UARTButton::dump_config
() { LOG_BUTTON(
""
,
"UART Button"
,
this
); }
14
15
}
// namespace esphome::uart
esphome::EntityBase::get_name
const StringRef & get_name() const
Definition
entity_base.cpp:11
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::UARTDevice::write_array
void write_array(const uint8_t *data, size_t len)
Definition
uart.h:26
log.h
esphome::spi::TAG
const char *const TAG
Definition
spi.cpp:8
esphome::uart
Definition
automation.h:8
uart_button.h
Generated by
1.12.0