ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
beo4_protocol.h
Go to the documentation of this file.
1#pragma once
2
3#include "remote_base.h"
4
5#include <cinttypes>
6
7namespace esphome::remote_base {
8
9struct Beo4Data {
10 uint8_t source; // beoSource, e.g. video, audio, light...
11 uint8_t command; // beoCommend, e.g. volume+, mute,...
12 uint8_t repeats; // beoRepeat for repeat commands, e.g. up, down...
13
14 bool operator==(const Beo4Data &rhs) const { return source == rhs.source && command == rhs.command; }
15};
16
17class Beo4Protocol : public RemoteProtocol<Beo4Data> {
18 public:
19 void encode(RemoteTransmitData *dst, const Beo4Data &data) override;
20 optional<Beo4Data> decode(RemoteReceiveData src) override;
21 void dump(const Beo4Data &data) override;
22};
23
24DECLARE_REMOTE_PROTOCOL(Beo4)
25
26template<typename... Ts> class Beo4Action : public RemoteTransmitterActionBase<Ts...> {
27 public:
28 TEMPLATABLE_VALUE(uint8_t, source)
29 TEMPLATABLE_VALUE(uint8_t, command)
30 TEMPLATABLE_VALUE(uint8_t, repeats)
31
32 void encode(RemoteTransmitData *dst, Ts... x) override {
33 Beo4Data data{};
34 data.source = this->source_.value(x...);
35 data.command = this->command_.value(x...);
36 data.repeats = this->repeats_.value(x...);
37 Beo4Protocol().encode(dst, data);
38 }
39};
40
41} // namespace esphome::remote_base
void dump(const Beo4Data &data) override
optional< Beo4Data > decode(RemoteReceiveData src) override
void encode(RemoteTransmitData *dst, const Beo4Data &data) override
bool operator==(const Beo4Data &rhs) const
uint16_t x
Definition tt21100.cpp:5