Use while loop for pir_holdtime

Ensures that the time keeps extending as long as the sensor is firing.
This commit is contained in:
Joshua Boniface 2023-11-22 20:23:58 -05:00
parent 4c04042aeb
commit 2ea97ac300

View File

@ -74,7 +74,11 @@ script:
then:
- lambda: |-
id(pir_motion).publish_state(true);
- delay: ${pir_holdtime}
- while:
condition:
binary_sensor.is_on: pir_gpio
then:
- delay: ${pir_holdtime}
- lambda: |-
id(pir_motion).publish_state(false);