[display] Test on_page_change with each from and to combination (#20457)

This commit is contained in:
J. Nick Koston
2026-10-09 21:40:40 -04:00
committed by GitHub
parent e894397503
commit bc44e8b550
2 changed files with 32 additions and 0 deletions
@@ -0,0 +1,26 @@
display:
- platform: ssd1306_i2c
i2c_id: i2c_bus
model: SSD1306_128X64
reset_pin: ${reset_pin}
id: display_page_change_display
pages:
- id: display_page_change_page1
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
- id: display_page_change_page2
lambda: |-
it.rectangle(0, 0, 10, 10);
on_page_change:
- then:
lambda: 'ESP_LOGD("display", "any change, %p %p", from, to);'
- from: display_page_change_page1
then:
lambda: 'ESP_LOGD("display", "left page 1, %p %p", from, to);'
- to: display_page_change_page1
then:
lambda: 'ESP_LOGD("display", "entered page 1, %p %p", from, to);'
- from: display_page_change_page1
to: display_page_change_page2
then:
lambda: 'ESP_LOGD("display", "1 -> 2, %p %p", from, to);'
@@ -0,0 +1,6 @@
substitutions:
reset_pin: GPIO15
packages:
i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml
display: !include common-page-change.yaml