Decode DP127 as 48 bytes (4 alarms), plus DP128, DP107 and DP126, from Tuya's data model. Add day switches, alarm and sunset controls, a knock sensor on PA18, display schedule, bedtime fade, radio timer and grouped web UI. Pin LibreTiny v1.14.0 for the OTA restart fix. Ship the patched UART as an external component so a server needs only a short YAML. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
600 B
C++
24 lines
600 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::uart {
|
|
|
|
class UARTButton final : public button::Button, public UARTDevice, public Component {
|
|
public:
|
|
void set_data(std::vector<uint8_t> &&data) { this->data_ = std::move(data); }
|
|
void set_data(std::initializer_list<uint8_t> data) { this->data_ = std::vector<uint8_t>(data); }
|
|
|
|
void dump_config() override;
|
|
|
|
protected:
|
|
void press_action() override;
|
|
std::vector<uint8_t> data_;
|
|
};
|
|
|
|
} // namespace esphome::uart
|