mirror of
https://github.com/esphome/esphome.git
synced 2026-10-11 05:44:15 +00:00
[display] Test on_page_change with each from and to combination (#20457)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user