moved some default scripts to base
This commit is contained in:
@@ -134,6 +134,7 @@ script:
|
|||||||
### pre-define draw scripts ###
|
### pre-define draw scripts ###
|
||||||
###############################
|
###############################
|
||||||
- id: bar1_left_draw
|
- id: bar1_left_draw
|
||||||
|
then:
|
||||||
- id: bar1_right_draw
|
- id: bar1_right_draw
|
||||||
then:
|
then:
|
||||||
- id: bar2_left_draw
|
- id: bar2_left_draw
|
||||||
@@ -159,22 +160,3 @@ script:
|
|||||||
- script.execute: update_bar2_right
|
- script.execute: update_bar2_right
|
||||||
- script.execute: update_bar3_left
|
- script.execute: update_bar3_left
|
||||||
- script.execute: update_bar3_right
|
- script.execute: update_bar3_right
|
||||||
######################
|
|
||||||
### paging scripts ###
|
|
||||||
######################
|
|
||||||
- id: next_page_main
|
|
||||||
then:
|
|
||||||
- display.page.show_next: main_display
|
|
||||||
- script.execute: update_main
|
|
||||||
- id: next_page_all
|
|
||||||
then:
|
|
||||||
- display.page.show_next: main_display
|
|
||||||
- script.execute: update_all
|
|
||||||
- id: prev_page_main
|
|
||||||
then:
|
|
||||||
- display.page.show_previous: main_display
|
|
||||||
- script.execute: update_main
|
|
||||||
- id: prev_page_all
|
|
||||||
then:
|
|
||||||
- display.page.show_previous: main_display
|
|
||||||
- script.execute: update_all
|
|
||||||
|
|||||||
@@ -23,6 +23,16 @@ spi:
|
|||||||
clk_pin: GPIO36
|
clk_pin: GPIO36
|
||||||
mosi_pin: GPIO35
|
mosi_pin: GPIO35
|
||||||
|
|
||||||
|
global:
|
||||||
|
- id: nr_of_pages
|
||||||
|
type: int
|
||||||
|
restore_value: no
|
||||||
|
initial_value: '1'
|
||||||
|
- id: actual_page
|
||||||
|
type: int
|
||||||
|
restore_value: no
|
||||||
|
initial_value: '0'
|
||||||
|
|
||||||
output:
|
output:
|
||||||
- platform: ledc
|
- platform: ledc
|
||||||
pin: GPIO3
|
pin: GPIO3
|
||||||
@@ -68,3 +78,26 @@ light:
|
|||||||
time:
|
time:
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: datetime
|
id: datetime
|
||||||
|
|
||||||
|
script:
|
||||||
|
######################
|
||||||
|
### paging scripts ###
|
||||||
|
######################
|
||||||
|
- id: next_page
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
id(actual_page) = id(actual_page) + 1;
|
||||||
|
if(id(actual_page) >= id(nr_of_pages)) {
|
||||||
|
id(actual_page) = 0;
|
||||||
|
}
|
||||||
|
- display.page.show_next: main_display
|
||||||
|
- script.execute: update_all
|
||||||
|
- id: prev_page
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
id(actual_page) = id(actual_page) - 1;
|
||||||
|
if(id(actual_page) <= 0 {
|
||||||
|
id(actual_page) = id(nr_of_pages);
|
||||||
|
}
|
||||||
|
- display.page.show_previous: main_display
|
||||||
|
- script.execute: update_all
|
||||||
|
|||||||
Reference in New Issue
Block a user