esphome/esphome/components/remote_base/coolix_protocol.h
Sergey Dudanov 9a70bfa471
New Midea IR component, improvements and fixes (#2847)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-10 11:47:19 +13:00

30 lines
807 B
C++

#pragma once
#include "esphome/core/component.h"
#include "esphome/core/helpers.h"
#include "remote_base.h"
namespace esphome {
namespace remote_base {
using CoolixData = uint32_t;
class CoolixProtocol : public RemoteProtocol<CoolixData> {
public:
void encode(RemoteTransmitData *dst, const CoolixData &data) override;
optional<CoolixData> decode(RemoteReceiveData data) override;
void dump(const CoolixData &data) override;
};
DECLARE_REMOTE_PROTOCOL(Coolix)
template<typename... Ts> class CoolixAction : public RemoteTransmitterActionBase<Ts...> {
TEMPLATABLE_VALUE(CoolixData, data)
void encode(RemoteTransmitData *dst, Ts... x) override {
CoolixData data = this->data_.value(x...);
CoolixProtocol().encode(dst, data);
}
};
} // namespace remote_base
} // namespace esphome