1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 13:22:19 +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

@@ -11,9 +11,9 @@ template<typename... Ts> class TurnOnAction : public Action<Ts...> {
public:
explicit TurnOnAction(Switch *a_switch) : switch_(a_switch) {}
protected:
void play_(Ts... x) override { this->switch_->turn_on(); }
void play(Ts... x) override { this->switch_->turn_on(); }
protected:
Switch *switch_;
};
@@ -21,9 +21,9 @@ template<typename... Ts> class TurnOffAction : public Action<Ts...> {
public:
explicit TurnOffAction(Switch *a_switch) : switch_(a_switch) {}
protected:
void play_(Ts... x) override { this->switch_->turn_off(); }
void play(Ts... x) override { this->switch_->turn_off(); }
protected:
Switch *switch_;
};
@@ -31,9 +31,9 @@ template<typename... Ts> class ToggleAction : public Action<Ts...> {
public:
explicit ToggleAction(Switch *a_switch) : switch_(a_switch) {}
protected:
void play_(Ts... x) override { this->switch_->toggle(); }
void play(Ts... x) override { this->switch_->toggle(); }
protected:
Switch *switch_;
};
@@ -74,8 +74,9 @@ template<typename... Ts> class SwitchPublishAction : public Action<Ts...> {
SwitchPublishAction(Switch *a_switch) : switch_(a_switch) {}
TEMPLATABLE_VALUE(bool, state)
void play(Ts... x) override { this->switch_->publish_state(this->state_.value(x...)); }
protected:
void play_(Ts... x) override { this->switch_->publish_state(this->state_.value(x...)); }
Switch *switch_;
};