I’m not sure the topic title explains very well what I want to do. Essentially, I have a touchscreen display running of an ESP32 Wrover module, and I want to toggle between screens using the touch.
At the moment, I tried this:
on_release:
- if:
condition:
display.is_displaying_page: page1
then:
- display.page.show: page2
- component.update: tft_ha
- if:
condition:
display.is_displaying_page: page2
then:
- display.page.show: page1
- component.update: tft_ha
Unfortunately, when it runs the actions from meeting the first condition, it then meets the second condition and runs that.
Is there a way of breaking out ?
I can get it to work like this, but it’s going to look really nasty when I start adding more pages:
on_release:
- if:
condition:
display.is_displaying_page: page1
then:
- display.page.show: page2
- component.update: tft_ha
else:
- if:
condition:
display.is_displaying_page: page2
then:
- display.page.show: page1
- component.update: tft_ha
Many thanks.