1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Autorepeat filter for the binary sensors (#1681)

* add the autorepeat filter

* add a test for the autorepeat filter

* make no timing equivalent to a single default one
This commit is contained in:
Stanislav Meduna
2021-05-13 22:36:53 +02:00
committed by GitHub
parent 54660300e9
commit 00c144daeb
4 changed files with 132 additions and 0 deletions

View File

@@ -86,6 +86,20 @@ binary_sensor:
- platform: tuya
id: tuya_binary_sensor
sensor_datapoint: 1
- platform: template
id: ar1
lambda: 'return {};'
filters:
- autorepeat:
- delay: 2s
time_off: 100ms
time_on: 900ms
- delay: 4s
time_off: 100ms
time_on: 400ms
on_state:
then:
- lambda: 'ESP_LOGI("ar1:", "%d", x);'
climate:
- platform: tuya