ESPHome  2024.11.0
jvc_protocol.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "remote_base.h"
4 
5 #include <cinttypes>
6 
7 namespace esphome {
8 namespace remote_base {
9 
10 struct JVCData {
11  uint32_t data;
12 
13  bool operator==(const JVCData &rhs) const { return data == rhs.data; }
14 };
15 
16 class JVCProtocol : public RemoteProtocol<JVCData> {
17  public:
18  void encode(RemoteTransmitData *dst, const JVCData &data) override;
19  optional<JVCData> decode(RemoteReceiveData src) override;
20  void dump(const JVCData &data) override;
21 };
22 
24 
25 template<typename... Ts> class JVCAction : public RemoteTransmitterActionBase<Ts...> {
26  public:
27  TEMPLATABLE_VALUE(uint32_t, data)
28 
29  void encode(RemoteTransmitData *dst, Ts... x) override {
30  JVCData data{};
31  data.data = this->data_.value(x...);
32  JVCProtocol().encode(dst, data);
33  }
34 };
35 
36 } // namespace remote_base
37 } // namespace esphome
DECLARE_REMOTE_PROTOCOL(AEHA) template< typename... Ts > class AEHAAction
Definition: aeha_protocol.h:27
uint16_t x
Definition: tt21100.cpp:17
bool operator==(const JVCData &rhs) const
Definition: jvc_protocol.h:13
void encode(RemoteTransmitData *dst, const JVCData &data) override
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7