mirror of
https://github.com/esphome/esphome.git
synced 2024-11-14 11:08:10 +01:00
Cease using deprecated Cover methods in automations (#2326)
This commit is contained in:
parent
4c61cf153c
commit
e3ffecefc0
1 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ template<typename... Ts> class OpenAction : public Action<Ts...> {
|
||||||
public:
|
public:
|
||||||
explicit OpenAction(Cover *cover) : cover_(cover) {}
|
explicit OpenAction(Cover *cover) : cover_(cover) {}
|
||||||
|
|
||||||
void play(Ts... x) override { this->cover_->open(); }
|
void play(Ts... x) override { this->cover_->make_call().set_command_open().perform(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Cover *cover_;
|
Cover *cover_;
|
||||||
|
@ -21,7 +21,7 @@ template<typename... Ts> class CloseAction : public Action<Ts...> {
|
||||||
public:
|
public:
|
||||||
explicit CloseAction(Cover *cover) : cover_(cover) {}
|
explicit CloseAction(Cover *cover) : cover_(cover) {}
|
||||||
|
|
||||||
void play(Ts... x) override { this->cover_->close(); }
|
void play(Ts... x) override { this->cover_->make_call().set_command_close().perform(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Cover *cover_;
|
Cover *cover_;
|
||||||
|
@ -31,7 +31,7 @@ template<typename... Ts> class StopAction : public Action<Ts...> {
|
||||||
public:
|
public:
|
||||||
explicit StopAction(Cover *cover) : cover_(cover) {}
|
explicit StopAction(Cover *cover) : cover_(cover) {}
|
||||||
|
|
||||||
void play(Ts... x) override { this->cover_->stop(); }
|
void play(Ts... x) override { this->cover_->make_call().set_command_stop().perform(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Cover *cover_;
|
Cover *cover_;
|
||||||
|
|
Loading…
Reference in a new issue