mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-27 17:37:45 +01:00
Fix if condition docs
This commit is contained in:
parent
058860af11
commit
ede025543e
@ -362,13 +362,14 @@ turns on a light for 5 seconds. Otherwise, the light is turned off immediately.
|
|||||||
on_...:
|
on_...:
|
||||||
then:
|
then:
|
||||||
- if:
|
- if:
|
||||||
lambda: 'return id(some_sensor).state < 30;'
|
condition:
|
||||||
then:
|
lambda: 'return id(some_sensor).state < 30;'
|
||||||
- lambda: 'ESP_LOGD("main", "The sensor value is below 30!");
|
then:
|
||||||
- light.turn_on: my_light
|
- lambda: 'ESP_LOGD("main", "The sensor value is below 30!");
|
||||||
- delay: 5s
|
- light.turn_on: my_light
|
||||||
else:
|
- delay: 5s
|
||||||
- lambda: 'ESP_LOGD("main", "The sensor value is above 30!");
|
else:
|
||||||
|
- lambda: 'ESP_LOGD("main", "The sensor value is above 30!");
|
||||||
- light.turn_off: my_light
|
- light.turn_off: my_light
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user