mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-22 18:26:30 +00:00
HASPmota added haspmota.page_show()
to change page (#20333)
This commit is contained in:
parent
6d94d9e766
commit
1f662a6dad
@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Matter support for password for remote Tasmota devices (#20296)
|
||||
- Display of active drivers using command ``status 4``
|
||||
- ESP32 used UART information
|
||||
- HASPmota added `haspmota.page_show()` to change page
|
||||
|
||||
### Breaking Changed
|
||||
- Refactoring of Berry `animate` module for WS2812 Leds (#20236)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1740,12 +1740,19 @@ class HASPmota
|
||||
#====================================================================
|
||||
def do_action(lvh_object, event_code)
|
||||
if event_code != lv.EVENT_CLICKED return end
|
||||
var action = lvh_object._action
|
||||
var cur_page = self.lvh_pages[self.lvh_page_cur_idx]
|
||||
# print("do_action","lvh_object",lvh_object,"action",action,"cur_page",cur_page,self.lvh_page_cur_idx)
|
||||
self.page_show(lvh_object._action)
|
||||
end
|
||||
|
||||
#====================================================================
|
||||
# Execute a page changing action from string `action`
|
||||
#
|
||||
# Arg1 `action` can be `prev`, `next`, `back` or `p<number>`
|
||||
# Returns: nil
|
||||
#====================================================================
|
||||
def page_show(action)
|
||||
# action can be `prev`, `next`, `back`, or `p<number>` like `p1`
|
||||
var to_page = nil
|
||||
var cur_page = self.lvh_pages[self.lvh_page_cur_idx]
|
||||
var sorted_pages_list = self.pages_list_sorted(self.lvh_page_cur_idx)
|
||||
if size(sorted_pages_list) <= 1 return end # if only 1 page, do nothing
|
||||
# handle prev/next/back values
|
||||
|
Loading…
x
Reference in New Issue
Block a user