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