mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
Allow haier remote protocol to use lambdas (#5898)
This commit is contained in:
parent
b5932940ee
commit
937a9c96ce
1 changed files with 2 additions and 3 deletions
|
@ -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 a new issue