moved some default scripts to base

This commit is contained in:
Martijn
2024-11-30 18:26:33 +01:00
parent f647fa2e12
commit a715bc2784
2 changed files with 34 additions and 19 deletions
+1 -19
View File
@@ -134,6 +134,7 @@ script:
### pre-define draw scripts ###
###############################
- id: bar1_left_draw
then:
- id: bar1_right_draw
then:
- id: bar2_left_draw
@@ -159,22 +160,3 @@ script:
- script.execute: update_bar2_right
- script.execute: update_bar3_left
- 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
+33
View File
@@ -23,6 +23,16 @@ spi:
clk_pin: GPIO36
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:
- platform: ledc
pin: GPIO3
@@ -68,3 +78,26 @@ light:
time:
- platform: homeassistant
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