mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-19 20:53:26 +02:00
6839de69c1
Co-authored-by: Samuel Sieb <samuel@sieb.net>
25 lines
515 B
C++
25 lines
515 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/uart/uart.h"
|
|
#include "esphome/components/button/button.h"
|
|
|
|
#include <vector>
|
|
|
|
namespace esphome {
|
|
namespace uart {
|
|
|
|
class UARTButton : public button::Button, public UARTDevice, public Component {
|
|
public:
|
|
void set_data(const std::vector<uint8_t> &data) { this->data_ = data; }
|
|
|
|
void dump_config() override;
|
|
|
|
protected:
|
|
void press_action() override;
|
|
std::vector<uint8_t> data_;
|
|
};
|
|
|
|
} // namespace uart
|
|
} // namespace esphome
|