mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 14:43:51 +00:00
Fix repeat.count = 0 case (#5364)
* Only play first action if count is non-zero * Add test to yaml * Update test5.yaml
This commit is contained in:
@@ -249,7 +249,11 @@ template<typename... Ts> class RepeatAction : public Action<Ts...> {
|
||||
void play_complex(Ts... x) override {
|
||||
this->num_running_++;
|
||||
this->var_ = std::make_tuple(x...);
|
||||
this->then_.play(0, x...);
|
||||
if (this->count_.value(x...) > 0) {
|
||||
this->then_.play(0, x...);
|
||||
} else {
|
||||
this->play_next_tuple_(this->var_);
|
||||
}
|
||||
}
|
||||
|
||||
void play(Ts... x) override { /* ignore - see play_complex */
|
||||
|
||||
Reference in New Issue
Block a user