mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-20 13:03:28 +02:00
8e75980ebd
* Cleanup dashboard JS * Add vscode * Save start_mark/end_mark * Updates * Updates * Remove need for cv.nameable It's a bit hacky but removes so much bloat from integrations * Add enum helper * Document APIs, and Improvements * Fixes * Fixes * Update PULL_REQUEST_TEMPLATE.md * Updates * Updates * Updates
23 lines
500 B
C++
23 lines
500 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/uart/uart.h"
|
|
#include "esphome/components/switch/switch.h"
|
|
|
|
namespace esphome {
|
|
namespace uart {
|
|
|
|
class UARTSwitch : public switch_::Switch, public UARTDevice, public Component {
|
|
public:
|
|
void set_data(const std::vector<uint8_t> &data) { data_ = data; }
|
|
|
|
void dump_config() override;
|
|
|
|
protected:
|
|
void write_state(bool state) override;
|
|
std::vector<uint8_t> data_;
|
|
};
|
|
|
|
} // namespace uart
|
|
} // namespace esphome
|