1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-26 20:53:50 +00:00

[binary_sensor] Optimize AutorepeatFilter with FixedVector

This commit is contained in:
J. Nick Koston
2025-10-20 22:09:22 -10:00
parent 5b13814a9e
commit 375adbb86f
4 changed files with 59 additions and 23 deletions

View File

@@ -37,3 +37,36 @@ binary_sensor:
format: "New state is %s"
args: ['x.has_value() ? ONOFF(x) : "Unknown"']
- binary_sensor.invalidate_state: some_binary_sensor
# Test autorepeat with default configuration (no timings)
- platform: template
id: autorepeat_default
name: "Autorepeat Default"
filters:
- autorepeat:
# Test autorepeat with single timing entry
- platform: template
id: autorepeat_single
name: "Autorepeat Single"
filters:
- autorepeat:
- delay: 2s
time_off: 200ms
time_on: 800ms
# Test autorepeat with three timing entries
- platform: template
id: autorepeat_multiple
name: "Autorepeat Multiple"
filters:
- autorepeat:
- delay: 500ms
time_off: 50ms
time_on: 950ms
- delay: 2s
time_off: 100ms
time_on: 900ms
- delay: 10s
time_off: 200ms
time_on: 800ms