ESPHome
2024.10.2
esphome
esphome
components
remote_base
haier_protocol.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
remote_base.h
"
4
#include <vector>
5
6
namespace
esphome
{
7
namespace
remote_base {
8
9
struct
HaierData
{
10
std::vector<uint8_t>
data
;
11
12
bool
operator==
(
const
HaierData
&rhs)
const
{
return
data == rhs.
data
; }
13
};
14
15
class
HaierProtocol
:
public
RemoteProtocol
<HaierData> {
16
public
:
17
void
encode(
RemoteTransmitData
*dst,
const
HaierData
&
data
)
override
;
18
optional<HaierData>
decode(
RemoteReceiveData
src)
override
;
19
void
dump(
const
HaierData
&data)
override
;
20
21
protected
:
22
void
encode_byte_(
RemoteTransmitData
*dst, uint8_t item);
23
};
24
25
DECLARE_REMOTE_PROTOCOL
(Haier)
26
27
template
<
typename
... Ts>
class
HaierAction :
public
RemoteTransmitterActionBase
<Ts...> {
28
public
:
29
TEMPLATABLE_VALUE(std::vector<uint8_t>, code)
30
31
void
encode(
RemoteTransmitData
*dst, Ts...
x
)
override
{
32
HaierData
data
{};
33
data
.data = this->code_.value(
x
...);
34
HaierProtocol
().
encode
(dst,
data
);
35
}
36
};
37
38
}
// namespace remote_base
39
}
// namespace esphome
esphome::remote_base::DECLARE_REMOTE_PROTOCOL
DECLARE_REMOTE_PROTOCOL(AEHA) template< typename... Ts > class AEHAAction
Definition:
aeha_protocol.h:27
x
uint16_t x
Definition:
tt21100.cpp:17
esphome::remote_base::RemoteTransmitData
Definition:
remote_base.h:25
esphome::remote_base::HaierProtocol
Definition:
haier_protocol.h:15
esphome::remote_base::HaierData
Definition:
haier_protocol.h:9
esphome::remote_base::HaierProtocol::encode
void encode(RemoteTransmitData *dst, const HaierData &data) override
Definition:
haier_protocol.cpp:27
esphome::remote_base::HaierData::data
std::vector< uint8_t > data
Definition:
haier_protocol.h:10
esphome::remote_base::HaierData::operator==
bool operator==(const HaierData &rhs) const
Definition:
haier_protocol.h:12
esphome::remote_base::RemoteProtocol
Definition:
remote_base.h:225
esphome::remote_base::RemoteTransmitterActionBase
Definition:
remote_base.h:279
esphome::remote_base::RemoteReceiveData
Definition:
remote_base.h:48
esphome::optional
Definition:
optional.h:36
remote_base.h
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
Generated by
1.8.13