Hello world,
Could someone please do me a solid and check my .yaml?
I’m still learning and are having trouble with using pages in the display block.
The error is:
←[32mINFO Reading configuration esp_poe_iso_sht31_pages.yaml...←[0m
←[31mERROR Error while reading config: Invalid YAML syntax. Please see YAML syntax reference or use an online YAML syntax validator:
while parsing a block collection
in "esp_poe_iso_sht31_pages.yaml", line 48, column 7:
- id: page1
^
expected <block end>, but found '<block sequence start>'
in "esp_poe_iso_sht31_pages.yaml", line 59, column 8:
- display.page.show_next: my_display
^←[0m
And the .yaml in question is…
display:
platform: ssd1306_i2c
model: SSD1306 128x64
id: my_display
#reset_pin D0
address: 0x3C
rotation: 0°
pages:
- id: page1
lambda: |-
if (id(temperature).has_state()) {
it.printf(10, 0, id(my_font), TextAlign::TOP_LEFT, "%.1f°", id(temperature).state);
}
- id: page2
lambda: |-
if (id(humidity).has_state()) {
it.printf(10, 0, id(my_font), TextAlign::TOP_LEFT, "%.1f°", id(humidity).state);
}
on_...:
- display.page.show_next: my_display
- display.page.show_previous: my_display
# For example cycle through pages on a timer
interval:
- interval: 5s
then:
- display.page.show_next: my_display
- component.update: my_display
Thanks and kudos for any help1