1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-04 02:52:22 +01:00
This commit is contained in:
Guillermo Ruffino
2020-05-24 23:27:28 -03:00
parent a62b6548d2
commit 1bec1faf6d
42 changed files with 151 additions and 176 deletions

View File

@@ -14,8 +14,7 @@ template<typename... Ts> class TurnOnAction : public Action<Ts...> {
TEMPLATABLE_VALUE(bool, oscillating)
TEMPLATABLE_VALUE(FanSpeed, speed)
protected:
void play_(Ts... x) override {
void play(Ts... x) override {
auto call = this->state_->turn_on();
if (this->oscillating_.has_value()) {
call.set_oscillating(this->oscillating_.value(x...));
@@ -33,8 +32,7 @@ template<typename... Ts> class TurnOffAction : public Action<Ts...> {
public:
explicit TurnOffAction(FanState *state) : state_(state) {}
protected:
void play_(Ts... x) override { this->state_->turn_off().perform(); }
void play(Ts... x) override { this->state_->turn_off().perform(); }
FanState *state_;
};
@@ -43,8 +41,7 @@ template<typename... Ts> class ToggleAction : public Action<Ts...> {
public:
explicit ToggleAction(FanState *state) : state_(state) {}
protected:
void play_(Ts... x) override { this->state_->toggle().perform(); }
void play(Ts... x) override { this->state_->toggle().perform(); }
FanState *state_;
};