mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 13:43:00 +00:00
30 lines
701 B
YAML
30 lines
701 B
YAML
esphome:
|
|
name: scheduler-delay-failed
|
|
|
|
host:
|
|
api:
|
|
logger:
|
|
level: DEBUG
|
|
|
|
globals:
|
|
- id: started
|
|
type: bool
|
|
restore_value: false
|
|
initial_value: "false"
|
|
|
|
# The interval marks itself failed, then schedules a delay. The delay must still fire: a failed
|
|
# component must not drop it, since the SELF_POINTER scheduler item has no owning component.
|
|
interval:
|
|
- interval: 100ms
|
|
id: host_interval
|
|
then:
|
|
- if:
|
|
condition:
|
|
lambda: "return !id(started);"
|
|
then:
|
|
- lambda: |-
|
|
id(started) = true;
|
|
id(host_interval)->mark_failed();
|
|
- delay: 200ms
|
|
- logger.log: "DELAY_FIRED_AFTER_FAIL"
|