mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 03:12:20 +01:00
Add display page abstraction (#435)
This commit is contained in:
@@ -1007,6 +1007,14 @@ fan:
|
||||
medium: 0.75
|
||||
high: 1.0
|
||||
|
||||
interval:
|
||||
- interval: 10s
|
||||
then:
|
||||
- display.page.show: !lambda |-
|
||||
if (true) return id(page1); else return id(page2);
|
||||
- display.page.show_next: display
|
||||
- display.page.show_previous: display
|
||||
|
||||
display:
|
||||
- platform: lcd_gpio
|
||||
dimensions: 18x4
|
||||
@@ -1037,8 +1045,14 @@ display:
|
||||
model: "SSD1306 128x64"
|
||||
reset_pin: GPIO23
|
||||
address: 0x3C
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
id: display
|
||||
pages:
|
||||
- id: page1
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
- id: page2
|
||||
lambda: |-
|
||||
// Nothing
|
||||
- platform: ssd1306_spi
|
||||
model: "SSD1306 128x64"
|
||||
cs_pin: GPIO23
|
||||
|
Reference in New Issue
Block a user