ESPHome 2025.5.0
Loading...
Searching...
No Matches
dish_protocol.h
Go to the documentation of this file.
1#pragma once
2
3#include "remote_base.h"
4
5namespace esphome {
6namespace remote_base {
7
8struct DishData {
9 uint8_t address;
10 uint8_t command;
11
12 bool operator==(const DishData &rhs) const { return address == rhs.address && command == rhs.command; }
13};
14
15class DishProtocol : public RemoteProtocol<DishData> {
16 public:
17 void encode(RemoteTransmitData *dst, const DishData &data) override;
19 void dump(const DishData &data) override;
20};
21
22DECLARE_REMOTE_PROTOCOL(Dish)
23
24template<typename... Ts> class DishAction : public RemoteTransmitterActionBase<Ts...> {
25 public:
26 TEMPLATABLE_VALUE(uint8_t, address)
27 TEMPLATABLE_VALUE(uint8_t, command)
28
29 void encode(RemoteTransmitData *dst, Ts... x) override {
30 DishData data{};
31 data.address = this->address_.value(x...);
32 data.command = this->command_.value(x...);
33 DishProtocol().encode(dst, data);
34 }
35};
36
37} // namespace remote_base
38} // namespace esphome
uint8_t address
Definition bl0906.h:4
void dump(const DishData &data) override
optional< DishData > decode(RemoteReceiveData src) override
void encode(RemoteTransmitData *dst, const DishData &data) override
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
bool operator==(const DishData &rhs) const
uint16_t x
Definition tt21100.cpp:5