HASPmota Change Page using GPIO0 or 14 button #20316
-
|
Running Tasmota, Berry and HASPmota on Lilygo T-Display-S3 ESP32 with a Non-Touch screen. Edit: The penny dropped regarding triggering a Berry function. This code worked from the console and prints (with a single press) So that just leaves the command to HASPmota to go to the next (or Previous) page to find. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
|
In Berry, you can select another page by calling the show method on the page object, like If you are maintaining the page number in the variable Note that the "primary" way of reacting to Buttons would be to trigger on |
Beta Was this translation helpful? Give feedback.
-
|
Fow what it's worth, I added haspmota.page_show('next') # move to next page
haspmota.page_show('prev') # move to previous page
haspmota.page_show('back') # move to home page
haspmota.page_show('p3') # move to page 3 |
Beta Was this translation helpful? Give feedback.
In Berry, you can select another page by calling the show method on the page object, like
p2.show()If you are maintaining the page number in the variable
page, you could code like this in Berry:global.member(f'p{page}').show()to reference the page object, and then call theshow()method.Note that the "primary" way of reacting to Buttons would be to trigger on
Button1#state, but that also depends on what other button configs you've made, and you may still need more than the mentioned trigger if you want to avoid the Button input triggering default actions in Tasmota.