1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

[scheduler] Fix DelayAction cancellation in restart mode scripts (#9646)

This commit is contained in:
J. Nick Koston
2025-07-17 18:07:59 -10:00
committed by GitHub
parent 1ebf157768
commit f0f76066f3
3 changed files with 117 additions and 2 deletions

View File

@@ -158,14 +158,14 @@ template<typename... Ts> class DelayAction : public Action<Ts...>, public Compon
void play_complex(Ts... x) override {
auto f = std::bind(&DelayAction<Ts...>::play_next_, this, x...);
this->num_running_++;
this->set_timeout(this->delay_.value(x...), f);
this->set_timeout("delay", this->delay_.value(x...), f);
}
float get_setup_priority() const override { return setup_priority::HARDWARE; }
void play(Ts... x) override { /* ignore - see play_complex */
}
void stop() override { this->cancel_timeout(""); }
void stop() override { this->cancel_timeout("delay"); }
};
template<typename... Ts> class LambdaAction : public Action<Ts...> {