add uart button (#5540)

Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
Samuel Sieb
2023-10-17 11:30:32 -07:00
committed by GitHub
parent b12dc98150
commit 6839de69c1
5 changed files with 81 additions and 0 deletions
@@ -0,0 +1,17 @@
#include "uart_button.h"
#include "esphome/core/log.h"
namespace esphome {
namespace uart {
static const char *const TAG = "uart.button";
void UARTButton::press_action() {
ESP_LOGD(TAG, "'%s': Sending data...", this->get_name().c_str());
this->write_array(this->data_.data(), this->data_.size());
}
void UARTButton::dump_config() { LOG_BUTTON("", "UART Button", this); }
} // namespace uart
} // namespace esphome