mirror of
https://github.com/esphome/esphome.git
synced 2026-10-14 10:12:52 +00:00
End the autorepeat table with a never-run step so the filter stores no count
This commit is contained in:
@@ -16,9 +16,11 @@ def test_autorepeat_timings_shared_progmem_table(
|
||||
)
|
||||
assert len(tables) == 2
|
||||
shared, default = tables
|
||||
assert main_cpp.count(f"AutorepeatFilter({shared}, 2);") == 2
|
||||
assert f"AutorepeatFilter({default}, 1);" in main_cpp
|
||||
assert main_cpp.count(f"AutorepeatFilter({shared});") == 2
|
||||
assert f"AutorepeatFilter({default});" in main_cpp
|
||||
assert "binary_sensor_autorepeat_timings" not in tables
|
||||
default_table = main_cpp.split(f"{default}[] PROGMEM = ", 1)[1].split(";", 1)[0]
|
||||
for field in (".delay = 1000", ".time_off = 100", ".time_on = 900"):
|
||||
assert field in default_table
|
||||
# Each table ends with a never-run delay instead of the filter storing a count.
|
||||
assert main_cpp.count(".delay = SCHEDULER_DONT_RUN") == len(tables)
|
||||
|
||||
Reference in New Issue
Block a user