#pragma once #include "esphome/core/component.h" #include "esphome/components/uart/uart.h" #include "esphome/components/button/button.h" #include namespace esphome::uart { class UARTButton : public button::Button, public UARTDevice, public Component { public: void set_data(std::vector &&data) { this->data_ = std::move(data); } void set_data(std::initializer_list data) { this->data_ = std::vector(data); } void dump_config() override; protected: void press_action() override; std::vector data_; }; } // namespace esphome::uart