#pragma once #ifdef USE_ARDUINO #include "esphome/core/automation.h" #include "air_conditioner.h" namespace esphome { namespace midea { namespace ac { template class MideaActionBase : public Action { public: void set_parent(AirConditioner *parent) { this->parent_ = parent; } protected: AirConditioner *parent_; }; template class FollowMeAction : public MideaActionBase { TEMPLATABLE_VALUE(float, temperature) TEMPLATABLE_VALUE(bool, beeper) void play(Ts... x) override { this->parent_->do_follow_me(this->temperature_.value(x...), this->beeper_.value(x...)); } }; template class SwingStepAction : public MideaActionBase { public: void play(Ts... x) override { this->parent_->do_swing_step(); } }; template class DisplayToggleAction : public MideaActionBase { public: void play(Ts... x) override { this->parent_->do_display_toggle(); } }; template class BeeperOnAction : public MideaActionBase { public: void play(Ts... x) override { this->parent_->do_beeper_on(); } }; template class BeeperOffAction : public MideaActionBase { public: void play(Ts... x) override { this->parent_->do_beeper_off(); } }; template class PowerOnAction : public MideaActionBase { public: void play(Ts... x) override { this->parent_->do_power_on(); } }; template class PowerOffAction : public MideaActionBase { public: void play(Ts... x) override { this->parent_->do_power_off(); } }; template class PowerToggleAction : public MideaActionBase { public: void play(Ts... x) override { this->parent_->do_power_toggle(); } }; } // namespace ac } // namespace midea } // namespace esphome #endif // USE_ARDUINO