mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			653 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			653 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
| 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"
 |