Display ON, OFF and TOGGLE action

Fixes #15
This commit is contained in:
GrKoR
2022-04-08 01:31:43 +03:00
parent 15006e3331
commit 9df49c72b3
3 changed files with 89 additions and 11 deletions

View File

@@ -0,0 +1,35 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/automation.h"
#include "aux_ac.h"
namespace esphome {
namespace aux_ac {
template <typename... Ts>
class AirConDisplayOffAction : public Action<Ts...>
{
public:
explicit AirConDisplayOffAction(AirCon *ac) : ac_(ac) {}
void play(Ts... x) override { this->ac_->displaySequence(AC_DISPLAY_OFF); }
protected:
AirCon *ac_;
};
template <typename... Ts>
class AirConDisplayOnAction : public Action<Ts...>
{
public:
explicit AirConDisplayOnAction(AirCon *ac) : ac_(ac) {}
void play(Ts... x) override { this->ac_->displaySequence(AC_DISPLAY_ON); }
protected:
AirCon *ac_;
};
} // namespace aux_ac
} // namespace esphome