paging is now indexed on 1
This commit is contained in:
+6
-6
@@ -31,7 +31,7 @@ spi:
|
||||
globals:
|
||||
- id: actual_page
|
||||
type: int
|
||||
initial_value: '0'
|
||||
initial_value: '1'
|
||||
- id: page_names
|
||||
type: std::vector<std::string>
|
||||
initial_value: '{"Page 1","Music","Page 3"}'
|
||||
@@ -102,15 +102,15 @@ number:
|
||||
name: "Menu Selector"
|
||||
id: menu_selector
|
||||
optimistic: true
|
||||
min_value: 0 # keep at 0
|
||||
max_value: ${nr_of_pages - 1}
|
||||
min_value: 1 # keep at 0
|
||||
max_value: ${nr_of_pages}
|
||||
step: 1
|
||||
on_value:
|
||||
then:
|
||||
# - script.execute: update_all
|
||||
- globals.set:
|
||||
id: actual_page
|
||||
value: !lambda 'return x;'
|
||||
- script.execute: update_all
|
||||
|
||||
script:
|
||||
######################
|
||||
@@ -128,7 +128,7 @@ script:
|
||||
# - number.set:
|
||||
# id: menu_selector
|
||||
# value: !lambda 'return float(id(actual_page));'
|
||||
# - script.execute: update_all
|
||||
- script.execute: update_all
|
||||
- id: prev_page
|
||||
then:
|
||||
- number.decrement:
|
||||
@@ -141,7 +141,7 @@ script:
|
||||
# # - number.set:
|
||||
# # id: menu_selector
|
||||
# # value: !lambda 'return float(id(actual_page));'
|
||||
# - script.execute: update_all
|
||||
- script.execute: update_all
|
||||
# - id: update_page
|
||||
# then:
|
||||
# - lambda: |-
|
||||
|
||||
Reference in New Issue
Block a user