diff --git a/hmi/dev/nspanel_eu_code/Program.s.txt b/hmi/dev/nspanel_eu_code/Program.s.txt index bdaf5e7..b2bb484 100644 --- a/hmi/dev/nspanel_eu_code/Program.s.txt +++ b/hmi/dev/nspanel_eu_code/Program.s.txt @@ -4,6 +4,7 @@ Program.s int r=0,g=0,b=0 int h=0,s=0,v=0 int p=0,q=0,t=0,f=0 + int is_buttonpage01=1, is_buttonpage02=1, is_buttonpage03=1, is_buttonpage04=1 int back_page_id=0 int dimdelta=0 int api=0 // 0 = disconnected from HA, 1 = connected to HA diff --git a/hmi/dev/nspanel_eu_code/buttonpage01.txt b/hmi/dev/nspanel_eu_code/buttonpage01.txt index 56fb3a3..2026b19 100644 --- a/hmi/dev/nspanel_eu_code/buttonpage01.txt +++ b/hmi/dev/nspanel_eu_code/buttonpage01.txt @@ -19,8 +19,21 @@ Page buttonpage01 { vis 255,0 vis button_back,1 - vis page_index,1 vis page_label,1 + page_index.txt+="●" + if(is_buttonpage02==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage03==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage04==1) + { + page_index.txt+="â—‹" + } + vis page_index,1 } Postinitialize Event @@ -70,7 +83,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ●○○○ + Text : Max. Text Size : 12 Text button01pic @@ -783,7 +796,19 @@ TouchCap swipe swipec2=0-swipedx if(swipec100) { - //page + if(is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else + { + page home + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + // Assume starting from buttonpage01 and aiming to navigate two pages ahead based on active pages. + if(is_buttonpage02==1) // Check if buttonpage02 is active + { + if(is_buttonpage03==1) // Then check if buttonpage03 is also active + { + page buttonpage03 // Navigate to buttonpage03 if both are active + }else if(is_buttonpage04==1) // If buttonpage03 is not active, but buttonpage04 is + { + page buttonpage04 // Navigate to buttonpage04, skipping buttonpage03 + }else + { + page home // Fallback if neither buttonpage03 nor buttonpage04 is active + } + }else if(is_buttonpage03==1) // If buttonpage02 is active + { + if(is_buttonpage04==1) // Check if buttonpage04 is active + { + page buttonpage04 // Navigate to buttonpage04, effectively skipping two pages + }else + { + page home // Fallback to home otherwise + } + }else + { + page home // Fallback to home if none of the conditions are met + } } } diff --git a/hmi/dev/nspanel_eu_code/buttonpage02.txt b/hmi/dev/nspanel_eu_code/buttonpage02.txt index 72e5fa6..3d479dc 100644 --- a/hmi/dev/nspanel_eu_code/buttonpage02.txt +++ b/hmi/dev/nspanel_eu_code/buttonpage02.txt @@ -19,8 +19,21 @@ Page buttonpage02 { vis 255,0 vis button_back,1 - vis page_index,1 vis page_label,1 + if(is_buttonpage01==1) + { + page_index.txt+="â—‹" + } + page_index.txt+="●" + if(is_buttonpage03==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage04==1) + { + page_index.txt+="â—‹" + } + vis page_index,1 } Postinitialize Event @@ -70,7 +83,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○●○○ + Text : Max. Text Size : 12 Text button01pic @@ -777,13 +790,28 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page buttonpage01 + if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_buttonpage01==1) + { + page home + }else + { + if(is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1) + { + page buttonpage03 + }else + { + page home + } + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + if(is_buttonpage03==1&&is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1||is_buttonpage04==1) + { + page home + }else + { + if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } + } } } diff --git a/hmi/dev/nspanel_eu_code/buttonpage03.txt b/hmi/dev/nspanel_eu_code/buttonpage03.txt index 1f2a720..ed1c1f0 100644 --- a/hmi/dev/nspanel_eu_code/buttonpage03.txt +++ b/hmi/dev/nspanel_eu_code/buttonpage03.txt @@ -19,8 +19,21 @@ Page buttonpage03 { vis 255,0 vis button_back,1 - vis page_index,1 vis page_label,1 + if(is_buttonpage01==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage02==1) + { + page_index.txt+="â—‹" + } + page_index.txt+="●" + if(is_buttonpage04==1) + { + page_index.txt+="â—‹" + } + vis page_index,1 } Postinitialize Event @@ -70,7 +83,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○○●○ + Text : Max. Text Size : 12 Text button01pic @@ -777,13 +790,30 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page buttonpage02 + // Navigate back based on active status + if(is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_buttonpage02==1&&is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage02==1||is_buttonpage01==1||is_buttonpage04==0) + { + page home + }else + { + page buttonpage04 + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + // Navigate back up the sequence based on active status + if(is_buttonpage04==1) + { + page home + }else if(is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_eu_code/buttonpage04.txt b/hmi/dev/nspanel_eu_code/buttonpage04.txt index a164813..16f2909 100644 --- a/hmi/dev/nspanel_eu_code/buttonpage04.txt +++ b/hmi/dev/nspanel_eu_code/buttonpage04.txt @@ -19,8 +19,21 @@ Page buttonpage04 { vis 255,0 vis button_back,1 - vis page_index,1 vis page_label,1 + if(is_buttonpage01==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage02==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage03==1) + { + page_index.txt+="â—‹" + } + page_index.txt+="●" + vis page_index,1 } Postinitialize Event @@ -70,7 +83,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○○○● + Text : Max. Text Size : 12 Text button01pic @@ -777,9 +790,22 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page buttonpage03 + // Navigate back based on active status + if(is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } } - // Right to Left + // Right to Left swipe now navigates to home, looping back to the start. swipec2=0-swipedx if(swipec100) { - //page + if(is_buttonpage03==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage03==1||is_buttonpage02==1) + { + if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } + }else + { + page home + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + // Navigate back up the sequence based on active status + if(is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage03==1) + { + page buttonpage03 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_us_code/Program.s.txt b/hmi/dev/nspanel_us_code/Program.s.txt index f0e5999..961c07d 100644 --- a/hmi/dev/nspanel_us_code/Program.s.txt +++ b/hmi/dev/nspanel_us_code/Program.s.txt @@ -4,6 +4,7 @@ Program.s int r=0,g=0,b=0 int h=0,s=0,v=0 int p=0,q=0,t=0,f=0 + int is_buttonpage01=1, is_buttonpage02=1, is_buttonpage03=1, is_buttonpage04=1 int back_page_id=0 int dimdelta=0 int api=0 // 0 = disconnected from HA, 1 = connected to HA diff --git a/hmi/dev/nspanel_us_code/buttonpage01.txt b/hmi/dev/nspanel_us_code/buttonpage01.txt index 56fb3a3..2026b19 100644 --- a/hmi/dev/nspanel_us_code/buttonpage01.txt +++ b/hmi/dev/nspanel_us_code/buttonpage01.txt @@ -19,8 +19,21 @@ Page buttonpage01 { vis 255,0 vis button_back,1 - vis page_index,1 vis page_label,1 + page_index.txt+="●" + if(is_buttonpage02==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage03==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage04==1) + { + page_index.txt+="â—‹" + } + vis page_index,1 } Postinitialize Event @@ -70,7 +83,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ●○○○ + Text : Max. Text Size : 12 Text button01pic @@ -783,7 +796,19 @@ TouchCap swipe swipec2=0-swipedx if(swipec100) { - //page + if(is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else + { + page home + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + // Assume starting from buttonpage01 and aiming to navigate two pages ahead based on active pages. + if(is_buttonpage02==1) // Check if buttonpage02 is active + { + if(is_buttonpage03==1) // Then check if buttonpage03 is also active + { + page buttonpage03 // Navigate to buttonpage03 if both are active + }else if(is_buttonpage04==1) // If buttonpage03 is not active, but buttonpage04 is + { + page buttonpage04 // Navigate to buttonpage04, skipping buttonpage03 + }else + { + page home // Fallback if neither buttonpage03 nor buttonpage04 is active + } + }else if(is_buttonpage03==1) // If buttonpage02 is active + { + if(is_buttonpage04==1) // Check if buttonpage04 is active + { + page buttonpage04 // Navigate to buttonpage04, effectively skipping two pages + }else + { + page home // Fallback to home otherwise + } + }else + { + page home // Fallback to home if none of the conditions are met + } } } diff --git a/hmi/dev/nspanel_us_code/buttonpage02.txt b/hmi/dev/nspanel_us_code/buttonpage02.txt index 72e5fa6..3d479dc 100644 --- a/hmi/dev/nspanel_us_code/buttonpage02.txt +++ b/hmi/dev/nspanel_us_code/buttonpage02.txt @@ -19,8 +19,21 @@ Page buttonpage02 { vis 255,0 vis button_back,1 - vis page_index,1 vis page_label,1 + if(is_buttonpage01==1) + { + page_index.txt+="â—‹" + } + page_index.txt+="●" + if(is_buttonpage03==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage04==1) + { + page_index.txt+="â—‹" + } + vis page_index,1 } Postinitialize Event @@ -70,7 +83,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○●○○ + Text : Max. Text Size : 12 Text button01pic @@ -777,13 +790,28 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page buttonpage01 + if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_buttonpage01==1) + { + page home + }else + { + if(is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1) + { + page buttonpage03 + }else + { + page home + } + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + if(is_buttonpage03==1&&is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1||is_buttonpage04==1) + { + page home + }else + { + if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } + } } } diff --git a/hmi/dev/nspanel_us_code/buttonpage03.txt b/hmi/dev/nspanel_us_code/buttonpage03.txt index 1f2a720..ed1c1f0 100644 --- a/hmi/dev/nspanel_us_code/buttonpage03.txt +++ b/hmi/dev/nspanel_us_code/buttonpage03.txt @@ -19,8 +19,21 @@ Page buttonpage03 { vis 255,0 vis button_back,1 - vis page_index,1 vis page_label,1 + if(is_buttonpage01==1) + { + page_index.txt+="â—‹" + } + if(is_buttonpage02==1) + { + page_index.txt+="â—‹" + } + page_index.txt+="●" + if(is_buttonpage04==1) + { + page_index.txt+="â—‹" + } + vis page_index,1 } Postinitialize Event @@ -70,7 +83,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○○●○ + Text : Max. Text Size : 12 Text button01pic @@ -777,13 +790,30 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page buttonpage02 + // Navigate back based on active status + if(is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_buttonpage02==1&&is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage02==1||is_buttonpage01==1||is_buttonpage04==0) + { + page home + }else + { + page buttonpage04 + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + // Navigate back up the sequence based on active status + if(is_buttonpage04==1) + { + page home + }else if(is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_us_code/buttonpage04.txt b/hmi/dev/nspanel_us_code/buttonpage04.txt index a164813..0f5f3e6 100644 --- a/hmi/dev/nspanel_us_code/buttonpage04.txt +++ b/hmi/dev/nspanel_us_code/buttonpage04.txt @@ -777,9 +777,22 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page buttonpage03 + // Navigate back based on active status + if(is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } } - // Right to Left + // Right to Left swipe now navigates to home, looping back to the start. swipec2=0-swipedx if(swipec100) { - //page + if(is_buttonpage03==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage03==1||is_buttonpage02==1) + { + if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + page home + } + }else + { + page home + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + // Navigate back up the sequence based on active status + if(is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage03==1) + { + page buttonpage03 + }else + { + page home + } } } diff --git a/hmi/nspanel_eu.HMI b/hmi/nspanel_eu.HMI index 2de6d51..cd3549e 100644 Binary files a/hmi/nspanel_eu.HMI and b/hmi/nspanel_eu.HMI differ diff --git a/hmi/nspanel_eu.tft b/hmi/nspanel_eu.tft index 2edc0af..77cfb9f 100644 Binary files a/hmi/nspanel_eu.tft and b/hmi/nspanel_eu.tft differ diff --git a/hmi/nspanel_us.HMI b/hmi/nspanel_us.HMI index 4af2592..1d7e538 100644 Binary files a/hmi/nspanel_us.HMI and b/hmi/nspanel_us.HMI differ diff --git a/hmi/nspanel_us.tft b/hmi/nspanel_us.tft index a58e840..2ca5d3a 100644 Binary files a/hmi/nspanel_us.tft and b/hmi/nspanel_us.tft differ diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 0923dd3..3a08abb 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -6059,6 +6059,239 @@ variables: am: 上午 pm: 下午 + ##### Button pages ##### + buttons_pages: + labels: + buttonpage01: !input button_page01_label + buttonpage02: !input button_page02_label + buttonpage03: !input button_page03_label + buttonpage04: !input button_page04_label + buttons: # Buttons 1 - 32 + - entity: !input 'entity01' + name: !input 'entity01_name' + icon: !input 'entity01_icon' + icon_color_rgb: !input 'entity01_icon_color' + confirm: !input 'entity01_confirm' + page: buttonpage01 + component: button01 + - entity: !input 'entity02' + name: !input 'entity02_name' + icon: !input 'entity02_icon' + icon_color_rgb: !input 'entity02_icon_color' + confirm: !input 'entity02_confirm' + page: buttonpage01 + component: button02 + - entity: !input 'entity03' + name: !input 'entity03_name' + icon: !input 'entity03_icon' + icon_color_rgb: !input 'entity03_icon_color' + confirm: !input 'entity03_confirm' + page: buttonpage01 + component: button03 + - entity: !input 'entity04' + name: !input 'entity04_name' + icon: !input 'entity04_icon' + icon_color_rgb: !input 'entity04_icon_color' + confirm: !input 'entity04_confirm' + page: buttonpage01 + component: button04 + - entity: !input 'entity05' + name: !input 'entity05_name' + icon: !input 'entity05_icon' + icon_color_rgb: !input 'entity05_icon_color' + confirm: !input 'entity05_confirm' + page: buttonpage01 + component: button05 + - entity: !input 'entity06' + name: !input 'entity06_name' + icon: !input 'entity06_icon' + icon_color_rgb: !input 'entity06_icon_color' + confirm: !input 'entity06_confirm' + page: buttonpage01 + component: button06 + - entity: !input 'entity07' + name: !input 'entity07_name' + icon: !input 'entity07_icon' + icon_color_rgb: !input 'entity07_icon_color' + confirm: !input 'entity07_confirm' + page: buttonpage01 + component: button07 + - entity: !input 'entity08' + name: !input 'entity08_name' + icon: !input 'entity08_icon' + icon_color_rgb: !input 'entity08_icon_color' + confirm: !input 'entity08_confirm' + page: buttonpage01 + component: button08 + - entity: !input 'entity09' + name: !input 'entity09_name' + icon: !input 'entity09_icon' + icon_color_rgb: !input 'entity09_icon_color' + confirm: !input 'entity09_confirm' + page: buttonpage02 + component: button01 + - entity: !input 'entity10' + name: !input 'entity10_name' + icon: !input 'entity10_icon' + icon_color_rgb: !input 'entity10_icon_color' + confirm: !input 'entity10_confirm' + page: buttonpage02 + component: button02 + - entity: !input 'entity11' + name: !input 'entity11_name' + icon: !input 'entity11_icon' + icon_color_rgb: !input 'entity11_icon_color' + confirm: !input 'entity11_confirm' + page: buttonpage02 + component: button03 + - entity: !input 'entity12' + name: !input 'entity12_name' + icon: !input 'entity12_icon' + icon_color_rgb: !input 'entity12_icon_color' + confirm: !input 'entity12_confirm' + page: buttonpage02 + component: button04 + - entity: !input 'entity13' + name: !input 'entity13_name' + icon: !input 'entity13_icon' + icon_color_rgb: !input 'entity13_icon_color' + confirm: !input 'entity13_confirm' + page: buttonpage02 + component: button05 + - entity: !input 'entity14' + name: !input 'entity14_name' + icon: !input 'entity14_icon' + icon_color_rgb: !input 'entity14_icon_color' + confirm: !input 'entity14_confirm' + page: buttonpage02 + component: button06 + - entity: !input 'entity15' + name: !input 'entity15_name' + icon: !input 'entity15_icon' + icon_color_rgb: !input 'entity15_icon_color' + confirm: !input 'entity15_confirm' + page: buttonpage02 + component: button07 + - entity: !input 'entity16' + name: !input 'entity16_name' + icon: !input 'entity16_icon' + icon_color_rgb: !input 'entity16_icon_color' + confirm: !input 'entity16_confirm' + page: buttonpage02 + component: button08 + - entity: !input 'entity17' + name: !input 'entity17_name' + icon: !input 'entity17_icon' + icon_color_rgb: !input 'entity17_icon_color' + confirm: !input 'entity17_confirm' + page: buttonpage03 + component: button01 + - entity: !input 'entity18' + name: !input 'entity18_name' + icon: !input 'entity18_icon' + icon_color_rgb: !input 'entity18_icon_color' + confirm: !input 'entity18_confirm' + page: buttonpage03 + component: button02 + - entity: !input 'entity19' + name: !input 'entity19_name' + icon: !input 'entity19_icon' + icon_color_rgb: !input 'entity19_icon_color' + confirm: !input 'entity19_confirm' + page: buttonpage03 + component: button03 + - entity: !input 'entity20' + name: !input 'entity20_name' + icon: !input 'entity20_icon' + icon_color_rgb: !input 'entity20_icon_color' + confirm: !input 'entity20_confirm' + page: buttonpage03 + component: button04 + - entity: !input 'entity21' + name: !input 'entity21_name' + icon: !input 'entity21_icon' + icon_color_rgb: !input 'entity21_icon_color' + confirm: !input 'entity21_confirm' + page: buttonpage03 + component: button05 + - entity: !input 'entity22' + name: !input 'entity22_name' + icon: !input 'entity22_icon' + icon_color_rgb: !input 'entity22_icon_color' + confirm: !input 'entity22_confirm' + page: buttonpage03 + component: button06 + - entity: !input 'entity23' + name: !input 'entity23_name' + icon: !input 'entity23_icon' + icon_color_rgb: !input 'entity23_icon_color' + confirm: !input 'entity23_confirm' + page: buttonpage03 + component: button07 + - entity: !input 'entity24' + name: !input 'entity24_name' + icon: !input 'entity24_icon' + icon_color_rgb: !input 'entity24_icon_color' + confirm: !input 'entity24_confirm' + page: buttonpage03 + component: button08 + - entity: !input 'entity25' + name: !input 'entity25_name' + icon: !input 'entity25_icon' + icon_color_rgb: !input 'entity25_icon_color' + confirm: !input 'entity25_confirm' + page: buttonpage04 + component: button01 + - entity: !input 'entity26' + name: !input 'entity26_name' + icon: !input 'entity26_icon' + icon_color_rgb: !input 'entity26_icon_color' + confirm: !input 'entity26_confirm' + page: buttonpage04 + component: button02 + - entity: !input 'entity27' + name: !input 'entity27_name' + icon: !input 'entity27_icon' + icon_color_rgb: !input 'entity27_icon_color' + confirm: !input 'entity27_confirm' + page: buttonpage04 + component: button03 + - entity: !input 'entity28' + name: !input 'entity28_name' + icon: !input 'entity28_icon' + icon_color_rgb: !input 'entity28_icon_color' + confirm: !input 'entity28_confirm' + page: buttonpage04 + component: button04 + - entity: !input 'entity29' + name: !input 'entity29_name' + icon: !input 'entity29_icon' + icon_color_rgb: !input 'entity29_icon_color' + confirm: !input 'entity29_confirm' + page: buttonpage04 + component: button05 + - entity: !input 'entity30' + name: !input 'entity30_name' + icon: !input 'entity30_icon' + icon_color_rgb: !input 'entity30_icon_color' + confirm: !input 'entity30_confirm' + page: buttonpage04 + component: button06 + - entity: !input 'entity31' + name: !input 'entity31_name' + icon: !input 'entity31_icon' + icon_color_rgb: !input 'entity31_icon_color' + confirm: !input 'entity31_confirm' + page: buttonpage04 + component: button07 + - entity: !input 'entity32' + name: !input 'entity32_name' + icon: !input 'entity32_icon' + icon_color_rgb: !input 'entity32_icon_color' + confirm: !input 'entity32_confirm' + page: buttonpage04 + component: button08 + ##### WEATHER #### weather_entity_tmp: !input 'weather_entity' # used only during the creation of weather in variables weather_entity: > @@ -7270,6 +7503,25 @@ action: decimal_separator: !input decimal_separator continue_on_error: true + - repeat: # Disable empty buttons pages + for_each: '{{ page.buttonpages }}' + sequence: + - service: '{{ nspanel.service.command }}' + data: + cmd: > + is_{{ repeat.item }}={{ + 1 + if + buttons_pages.buttons | + selectattr("page", "defined") | + selectattr("page", "eq", repeat.item) | + selectattr("entity", "defined") | + list | + count > 0 + else 0 + }} + continue_on_error: true + ##### Update Date & Time before showing the Home page ##### - *refresh-date @@ -7738,240 +7990,9 @@ action: event_page: '{{ nspanel_event.page if nspanel_event is defined and nspanel_event.page is defined else page.current }}' button_pages_icon_size: !input button_pages_icon_size ##### BUTTON Page Labels ##### - button_pages_labels: - buttonpage01: !input button_page01_label - buttonpage02: !input button_page02_label - buttonpage03: !input button_page03_label - buttonpage04: !input button_page04_label - ##### BUTTONS Page - Buttons 1 - 32 ##### - button_pages_buttons: - - entity: !input 'entity01' - name: !input 'entity01_name' - icon: !input 'entity01_icon' - icon_color_rgb: !input 'entity01_icon_color' - confirm: !input 'entity01_confirm' - page: buttonpage01 - component: button01 - - entity: !input 'entity02' - name: !input 'entity02_name' - icon: !input 'entity02_icon' - icon_color_rgb: !input 'entity02_icon_color' - confirm: !input 'entity02_confirm' - page: buttonpage01 - component: button02 - - entity: !input 'entity03' - name: !input 'entity03_name' - icon: !input 'entity03_icon' - icon_color_rgb: !input 'entity03_icon_color' - confirm: !input 'entity03_confirm' - page: buttonpage01 - component: button03 - - entity: !input 'entity04' - name: !input 'entity04_name' - icon: !input 'entity04_icon' - icon_color_rgb: !input 'entity04_icon_color' - confirm: !input 'entity04_confirm' - page: buttonpage01 - component: button04 - - entity: !input 'entity05' - name: !input 'entity05_name' - icon: !input 'entity05_icon' - icon_color_rgb: !input 'entity05_icon_color' - confirm: !input 'entity05_confirm' - page: buttonpage01 - component: button05 - - entity: !input 'entity06' - name: !input 'entity06_name' - icon: !input 'entity06_icon' - icon_color_rgb: !input 'entity06_icon_color' - confirm: !input 'entity06_confirm' - page: buttonpage01 - component: button06 - - entity: !input 'entity07' - name: !input 'entity07_name' - icon: !input 'entity07_icon' - icon_color_rgb: !input 'entity07_icon_color' - confirm: !input 'entity07_confirm' - page: buttonpage01 - component: button07 - - entity: !input 'entity08' - name: !input 'entity08_name' - icon: !input 'entity08_icon' - icon_color_rgb: !input 'entity08_icon_color' - confirm: !input 'entity08_confirm' - page: buttonpage01 - component: button08 - - entity: !input 'entity09' - name: !input 'entity09_name' - icon: !input 'entity09_icon' - icon_color_rgb: !input 'entity09_icon_color' - confirm: !input 'entity09_confirm' - page: buttonpage02 - component: button01 - - entity: !input 'entity10' - name: !input 'entity10_name' - icon: !input 'entity10_icon' - icon_color_rgb: !input 'entity10_icon_color' - confirm: !input 'entity10_confirm' - page: buttonpage02 - component: button02 - - entity: !input 'entity11' - name: !input 'entity11_name' - icon: !input 'entity11_icon' - icon_color_rgb: !input 'entity11_icon_color' - confirm: !input 'entity11_confirm' - page: buttonpage02 - component: button03 - - entity: !input 'entity12' - name: !input 'entity12_name' - icon: !input 'entity12_icon' - icon_color_rgb: !input 'entity12_icon_color' - confirm: !input 'entity12_confirm' - page: buttonpage02 - component: button04 - - entity: !input 'entity13' - name: !input 'entity13_name' - icon: !input 'entity13_icon' - icon_color_rgb: !input 'entity13_icon_color' - confirm: !input 'entity13_confirm' - page: buttonpage02 - component: button05 - - entity: !input 'entity14' - name: !input 'entity14_name' - icon: !input 'entity14_icon' - icon_color_rgb: !input 'entity14_icon_color' - confirm: !input 'entity14_confirm' - page: buttonpage02 - component: button06 - - entity: !input 'entity15' - name: !input 'entity15_name' - icon: !input 'entity15_icon' - icon_color_rgb: !input 'entity15_icon_color' - confirm: !input 'entity15_confirm' - page: buttonpage02 - component: button07 - - entity: !input 'entity16' - name: !input 'entity16_name' - icon: !input 'entity16_icon' - icon_color_rgb: !input 'entity16_icon_color' - confirm: !input 'entity16_confirm' - page: buttonpage02 - component: button08 - - entity: !input 'entity17' - name: !input 'entity17_name' - icon: !input 'entity17_icon' - icon_color_rgb: !input 'entity17_icon_color' - confirm: !input 'entity17_confirm' - page: buttonpage03 - component: button01 - - entity: !input 'entity18' - name: !input 'entity18_name' - icon: !input 'entity18_icon' - icon_color_rgb: !input 'entity18_icon_color' - confirm: !input 'entity18_confirm' - page: buttonpage03 - component: button02 - - entity: !input 'entity19' - name: !input 'entity19_name' - icon: !input 'entity19_icon' - icon_color_rgb: !input 'entity19_icon_color' - confirm: !input 'entity19_confirm' - page: buttonpage03 - component: button03 - - entity: !input 'entity20' - name: !input 'entity20_name' - icon: !input 'entity20_icon' - icon_color_rgb: !input 'entity20_icon_color' - confirm: !input 'entity20_confirm' - page: buttonpage03 - component: button04 - - entity: !input 'entity21' - name: !input 'entity21_name' - icon: !input 'entity21_icon' - icon_color_rgb: !input 'entity21_icon_color' - confirm: !input 'entity21_confirm' - page: buttonpage03 - component: button05 - - entity: !input 'entity22' - name: !input 'entity22_name' - icon: !input 'entity22_icon' - icon_color_rgb: !input 'entity22_icon_color' - confirm: !input 'entity22_confirm' - page: buttonpage03 - component: button06 - - entity: !input 'entity23' - name: !input 'entity23_name' - icon: !input 'entity23_icon' - icon_color_rgb: !input 'entity23_icon_color' - confirm: !input 'entity23_confirm' - page: buttonpage03 - component: button07 - - entity: !input 'entity24' - name: !input 'entity24_name' - icon: !input 'entity24_icon' - icon_color_rgb: !input 'entity24_icon_color' - confirm: !input 'entity24_confirm' - page: buttonpage03 - component: button08 - - entity: !input 'entity25' - name: !input 'entity25_name' - icon: !input 'entity25_icon' - icon_color_rgb: !input 'entity25_icon_color' - confirm: !input 'entity25_confirm' - page: buttonpage04 - component: button01 - - entity: !input 'entity26' - name: !input 'entity26_name' - icon: !input 'entity26_icon' - icon_color_rgb: !input 'entity26_icon_color' - confirm: !input 'entity26_confirm' - page: buttonpage04 - component: button02 - - entity: !input 'entity27' - name: !input 'entity27_name' - icon: !input 'entity27_icon' - icon_color_rgb: !input 'entity27_icon_color' - confirm: !input 'entity27_confirm' - page: buttonpage04 - component: button03 - - entity: !input 'entity28' - name: !input 'entity28_name' - icon: !input 'entity28_icon' - icon_color_rgb: !input 'entity28_icon_color' - confirm: !input 'entity28_confirm' - page: buttonpage04 - component: button04 - - entity: !input 'entity29' - name: !input 'entity29_name' - icon: !input 'entity29_icon' - icon_color_rgb: !input 'entity29_icon_color' - confirm: !input 'entity29_confirm' - page: buttonpage04 - component: button05 - - entity: !input 'entity30' - name: !input 'entity30_name' - icon: !input 'entity30_icon' - icon_color_rgb: !input 'entity30_icon_color' - confirm: !input 'entity30_confirm' - page: buttonpage04 - component: button06 - - entity: !input 'entity31' - name: !input 'entity31_name' - icon: !input 'entity31_icon' - icon_color_rgb: !input 'entity31_icon_color' - confirm: !input 'entity31_confirm' - page: buttonpage04 - component: button07 - - entity: !input 'entity32' - name: !input 'entity32_name' - icon: !input 'entity32_icon' - icon_color_rgb: !input 'entity32_icon_color' - confirm: !input 'entity32_confirm' - page: buttonpage04 - component: button08 confirm_list: > {{ - button_pages_buttons + buttons_pages.buttons | selectattr("page", "defined") | selectattr("page", "eq", event_page) | sort(attribute="component") @@ -7990,12 +8011,12 @@ action: - if: '{{ event_page in page.buttonpages }}' then: ##### Button page Label ##### - - if: '{{ button_pages_labels[event_page] | length > 0 }}' + - if: '{{ buttons_pages.labels[event_page] | length > 0 }}' then: - service: '{{ nspanel.service.component.text }}' data: id: page_label - txt: '{{ button_pages_labels[event_page] }}' + txt: '{{ buttons_pages.labels[event_page] }}' continue_on_error: true ###### Confirm buttons ###### @@ -8009,7 +8030,7 @@ action: - repeat: for_each: > {{ - button_pages_buttons + buttons_pages.buttons | selectattr("page", "defined") | selectattr("page", "eq", event_page) | selectattr("entity", "defined") @@ -9511,7 +9532,7 @@ action: - variables: last_click_button: > {{ - button_pages_buttons + buttons_pages.buttons | selectattr("page", "defined") | selectattr("page", "eq", nspanel_event.page) | selectattr("component", "defined") @@ -9836,7 +9857,7 @@ action: - repeat: for_each: > {{ - button_pages_buttons + buttons_pages.buttons | selectattr("page", "defined") | selectattr("page", "eq", page.current) | selectattr("entity", "defined")