mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 11:47:30 +01:00
Allow haier remote protocol to use lambdas (#5898)
This commit is contained in:
parent
b5932940ee
commit
937a9c96ce
@ -26,12 +26,11 @@ DECLARE_REMOTE_PROTOCOL(Haier)
|
||||
|
||||
template<typename... Ts> class HaierAction : public RemoteTransmitterActionBase<Ts...> {
|
||||
public:
|
||||
TEMPLATABLE_VALUE(std::vector<uint8_t>, data)
|
||||
TEMPLATABLE_VALUE(std::vector<uint8_t>, code)
|
||||
|
||||
void set_code(const std::vector<uint8_t> &code) { data_ = code; }
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
HaierData data{};
|
||||
data.data = this->data_.value(x...);
|
||||
data.data = this->code_.value(x...);
|
||||
HaierProtocol().encode(dst, data);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user