mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-01 10:38:27 +02:00
Implement the finish() method and action. implement the is_stopped condition (#7255)
This commit is contained in:
@@ -39,10 +39,20 @@ template<typename... Ts> class StopAction : public Action<Ts...>, public Parente
|
||||
void play(Ts... x) override { this->parent_->stop(); }
|
||||
};
|
||||
|
||||
template<typename... Ts> class FinishAction : public Action<Ts...>, public Parented<Speaker> {
|
||||
public:
|
||||
void play(Ts... x) override { this->parent_->finish(); }
|
||||
};
|
||||
|
||||
template<typename... Ts> class IsPlayingCondition : public Condition<Ts...>, public Parented<Speaker> {
|
||||
public:
|
||||
bool check(Ts... x) override { return this->parent_->is_running(); }
|
||||
};
|
||||
|
||||
template<typename... Ts> class IsStoppedCondition : public Condition<Ts...>, public Parented<Speaker> {
|
||||
public:
|
||||
bool check(Ts... x) override { return this->parent_->is_stopped(); }
|
||||
};
|
||||
|
||||
} // namespace speaker
|
||||
} // namespace esphome
|
||||
|
||||
Reference in New Issue
Block a user