1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-31 07:03:55 +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

@@ -0,0 +1,24 @@
esphome:
name: test-delay-action
host:
api:
actions:
- action: start_delay_then_restart
then:
- logger.log: "Starting first script execution"
- script.execute: test_delay_script
- delay: 250ms # Give first script time to start delay
- logger.log: "Restarting script (should cancel first delay)"
- script.execute: test_delay_script
logger:
level: DEBUG
script:
- id: test_delay_script
mode: restart
then:
- logger.log: "Script started, beginning delay"
- delay: 500ms # Long enough that it won't complete before restart
- logger.log: "Delay completed successfully"