mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 16:20:42 +00:00
31 lines
675 B
YAML
31 lines
675 B
YAML
esphome:
|
|
name: scheduler-blocking-generic
|
|
|
|
host:
|
|
api:
|
|
logger:
|
|
level: DEBUG
|
|
|
|
globals:
|
|
- id: done
|
|
type: bool
|
|
restore_value: false
|
|
initial_value: "false"
|
|
|
|
# A delay in a plain (non-script) automation has no owning script, so the block must log the
|
|
# generic "a scheduled task" label, not a script name.
|
|
interval:
|
|
- interval: 100ms
|
|
id: gen_interval
|
|
then:
|
|
- if:
|
|
condition:
|
|
lambda: "return !id(done);"
|
|
then:
|
|
- lambda: "id(done) = true;"
|
|
- delay: 10ms
|
|
- lambda: |-
|
|
const uint32_t start = millis();
|
|
while (millis() - start < 80) {
|
|
}
|