ESPHome
2024.10.2
esphome
esphome
components
remote_base
roomba_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
RoombaData
{
9
uint8_t
data
;
10
11
bool
operator==
(
const
RoombaData
&rhs)
const
{
return
data == rhs.
data
; }
12
};
13
14
class
RoombaProtocol
:
public
RemoteProtocol
<RoombaData> {
15
public
:
16
void
encode(
RemoteTransmitData
*dst,
const
RoombaData
&
data
)
override
;
17
optional<RoombaData>
decode(
RemoteReceiveData
src)
override
;
18
void
dump(
const
RoombaData
&data)
override
;
19
};
20
21
DECLARE_REMOTE_PROTOCOL
(Roomba)
22
23
template
<
typename
... Ts>
class
RoombaAction :
public
RemoteTransmitterActionBase
<Ts...> {
24
public
:
25
TEMPLATABLE_VALUE(uint8_t,
data
)
26
27
void
encode(
RemoteTransmitData
*dst, Ts...
x
)
override
{
28
RoombaData
data
{};
29
data
.data = this->data_.value(
x
...);
30
RoombaProtocol
().
encode
(dst,
data
);
31
}
32
};
33
34
}
// namespace remote_base
35
}
// namespace esphome
esphome::remote_base::RoombaData
Definition:
roomba_protocol.h:8
esphome::remote_base::RoombaProtocol
Definition:
roomba_protocol.h:14
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::RoombaData::data
uint8_t data
Definition:
roomba_protocol.h:9
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
esphome::remote_base::RoombaProtocol::encode
void encode(RemoteTransmitData *dst, const RoombaData &data) override
Definition:
roomba_protocol.cpp:15
remote_base.h
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
esphome::remote_base::RoombaData::operator==
bool operator==(const RoombaData &rhs) const
Definition:
roomba_protocol.h:11
Generated by
1.8.13