diff --git a/hmi/dev/nspanel_eu_code/Program.s.txt b/hmi/dev/nspanel_eu_code/Program.s.txt index b2bb484..23379dd 100644 --- a/hmi/dev/nspanel_eu_code/Program.s.txt +++ b/hmi/dev/nspanel_eu_code/Program.s.txt @@ -5,6 +5,7 @@ Program.s 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 is_entitypage01=1, is_entitypage02=1, is_entitypage03=1, is_entitypage04=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/buttonpage04.txt b/hmi/dev/nspanel_eu_code/buttonpage04.txt index 16f2909..088a871 100644 --- a/hmi/dev/nspanel_eu_code/buttonpage04.txt +++ b/hmi/dev/nspanel_eu_code/buttonpage04.txt @@ -791,15 +791,15 @@ TouchCap swipe if(swipec>swipedx) { // Navigate back based on active status - if(is_buttonpage03==1) + if(is_entitypage03==1) { - page buttonpage03 - }else if(is_buttonpage02==1) + page entitypage03 + }else if(is_entitypage02==1) { - page buttonpage02 - }else if(is_buttonpage01==1) + page entitypage02 + }else if(is_entitypage01==1) { - page buttonpage01 + page entitypage01 }else { page home @@ -819,14 +819,14 @@ TouchCap swipe // From Up to Down if(swipec>100) { - if(is_buttonpage03==1&&is_buttonpage02==1) + if(is_entitypage03==1&&is_entitypage02==1) { - page buttonpage02 - }else if(is_buttonpage03==1||is_buttonpage02==1) + page entitypage02 + }else if(is_entitypage03==1||is_entitypage02==1) { - if(is_buttonpage01==1) + if(is_entitypage01==1) { - page buttonpage01 + page entitypage01 }else { page home @@ -841,15 +841,15 @@ TouchCap swipe if(swipec<-100) { // Navigate back up the sequence based on active status - if(is_buttonpage01==1) + if(is_entitypage01==1) { - page buttonpage01 - }else if(is_buttonpage02==1) + page entitypage01 + }else if(is_entitypage02==1) { - page buttonpage02 - }else if(is_buttonpage03==1) + page entitypage02 + }else if(is_entitypage03==1) { - page buttonpage03 + page entitypage03 }else { page home diff --git a/hmi/dev/nspanel_eu_code/entitypage01.txt b/hmi/dev/nspanel_eu_code/entitypage01.txt index ceb8e33..977a7b4 100644 --- a/hmi/dev/nspanel_eu_code/entitypage01.txt +++ b/hmi/dev/nspanel_eu_code/entitypage01.txt @@ -17,6 +17,19 @@ Page entitypage01 page home } vis unavailable,0 + page_index.txt+="●" + if(is_entitypage02==1) + { + page_index.txt+="○" + } + if(is_entitypage03==1) + { + page_index.txt+="○" + } + if(is_entitypage04==1) + { + page_index.txt+="○" + } Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity01_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ●○○○ + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,25 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage04 + page home } // Right to Left swipec2=0-swipedx if(swipec100) { - page entitypage03 + if(is_entitypage04==1) + { + page entitypage04 + }else if(is_entitypage03==1) + { + page entitypage03 + }else if(is_entitypage02==1) + { + page entitypage02 + }else + { + page home + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - page entitypage04 + if(is_entitypage02==1) // Check if entitypage02 is active + { + if(is_entitypage03==1) // Then check if entitypage03 is also active + { + page entitypage03 // Navigate to entitypage03 if both are active + }else if(is_entitypage04==1) // If entitypage03 is not active, but entitypage04 is + { + page entitypage04 // Navigate to entitypage04, skipping entitypage03 + }else + { + page home // Fallback if neither entitypage03 nor entitypage04 is active + } + }else if(is_entitypage03==1) // If entitypage02 is not active, check entitypage03 directly + { + if(is_entitypage04==1) // Check if entitypage04 is active + { + page entitypage04 // Navigate to entitypage04, 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/entitypage02.txt b/hmi/dev/nspanel_eu_code/entitypage02.txt index 1ba1ec3..4b25de6 100644 --- a/hmi/dev/nspanel_eu_code/entitypage02.txt +++ b/hmi/dev/nspanel_eu_code/entitypage02.txt @@ -17,6 +17,19 @@ Page entitypage02 page home } vis unavailable,0 + if(is_entitypage01==1) + { + page_index.txt+="○" + } + page_index.txt+="●" + if(is_entitypage03==1) + { + page_index.txt+="○" + } + if(is_entitypage04==1) + { + page_index.txt+="○" + } Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity02_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○●○○ + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,28 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage01 + if(is_entitypage01==1) + { + page entitypage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_entitypage01==1) + { + page home + }else + { + if(is_entitypage04==1) + { + page entitypage04 + }else if(is_entitypage03==1) + { + page entitypage03 + }else + { + page home + } + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + if(is_entitypage03==1&&is_entitypage04==1) + { + page entitypage04 + }else if(is_entitypage03==1||is_entitypage04==1) + { + page home + }else + { + if(is_entitypage01==1) + { + page entitypage01 + }else + { + page home + } + } } } diff --git a/hmi/dev/nspanel_eu_code/entitypage03.txt b/hmi/dev/nspanel_eu_code/entitypage03.txt index 7286e7d..38e1097 100644 --- a/hmi/dev/nspanel_eu_code/entitypage03.txt +++ b/hmi/dev/nspanel_eu_code/entitypage03.txt @@ -17,6 +17,19 @@ Page entitypage03 page home } vis unavailable,0 + if(is_entitypage01==1) + { + page_index.txt+="○" + } + if(is_entitypage02==1) + { + page_index.txt+="○" + } + page_index.txt+="●" + if(is_entitypage04==1) + { + page_index.txt+="○" + } Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity03_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○○●○ + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,28 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage02 + if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage01==1) + { + page entitypage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_entitypage02==1&&is_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1||is_entitypage01==1||is_entitypage04==0) + { + page home + }else + { + page entitypage04 + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - page entitypage01 + if(is_entitypage04==1) + { + page home + }else if(is_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1) + { + page entitypage02 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_eu_code/entitypage04.txt b/hmi/dev/nspanel_eu_code/entitypage04.txt index e8e84f8..a7c0222 100644 --- a/hmi/dev/nspanel_eu_code/entitypage04.txt +++ b/hmi/dev/nspanel_eu_code/entitypage04.txt @@ -17,6 +17,19 @@ Page entitypage04 page home } vis unavailable,0 + if(is_entitypage01==1) + { + page_index.txt+="○" + } + if(is_entitypage02==1) + { + page_index.txt+="○" + } + if(is_entitypage03==1) + { + page_index.txt+="○" + } + page_index.txt+="●" Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity04_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○○○● + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,26 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage03 + // Navigate back based on active status + if(is_entitypage03==1) + { + page entitypage03 + }else if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage01==1) + { + page entitypage01 + }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 entitypage01 + if(is_entitypage03==1&&is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage03==1||is_entitypage02==1) + { + if(is_entitypage01==1) + { + page entitypage01 + }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_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage03==1) + { + page entitypage03 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_eu_code/home.txt b/hmi/dev/nspanel_eu_code/home.txt index 43044a3..e8109d7 100644 --- a/hmi/dev/nspanel_eu_code/home.txt +++ b/hmi/dev/nspanel_eu_code/home.txt @@ -686,15 +686,47 @@ TouchCap swipe { swipec=swipex-tch2 // From Left to Right - if(swipec>swipedx&&api==1) + if(swipec>swipedx) { - page buttonpage04 + // Navigate back based on active status + if(is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + // Do nothing + } } - // Right to Left + // Right to Left swipe now navigates to home, looping back to the start. swipec2=0-swipedx - if(swipec100&&api==1) + if(swipec>100) { - page buttonpage02 + if(is_buttonpage04==1&&is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage04==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage04==1&&is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage03==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage03==1&&is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage02==1&&is_buttonpage01==1) + { + page buttonpage01 + }else + { + // Do nothing + } } // Down to Up - swipec2=0-swipedy - if(swipec<-100&&api==1) + swipec=0-swipedy + if(swipec<-100) { - page buttonpage03 + // Navigate back up the sequence based on active status + if(is_buttonpage01==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1&&is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage01==1&&is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage02==1&&is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1&&is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1&&is_buttonpage04==1) + { + page buttonpage04 + }else + { + // Do nothing + } } } diff --git a/hmi/dev/nspanel_us_code/Program.s.txt b/hmi/dev/nspanel_us_code/Program.s.txt index 961c07d..a96b53c 100644 --- a/hmi/dev/nspanel_us_code/Program.s.txt +++ b/hmi/dev/nspanel_us_code/Program.s.txt @@ -5,6 +5,7 @@ Program.s 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 is_entitypage01=1, is_entitypage02=1, is_entitypage03=1, is_entitypage04=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/entitypage01.txt b/hmi/dev/nspanel_us_code/entitypage01.txt index ceb8e33..977a7b4 100644 --- a/hmi/dev/nspanel_us_code/entitypage01.txt +++ b/hmi/dev/nspanel_us_code/entitypage01.txt @@ -17,6 +17,19 @@ Page entitypage01 page home } vis unavailable,0 + page_index.txt+="●" + if(is_entitypage02==1) + { + page_index.txt+="○" + } + if(is_entitypage03==1) + { + page_index.txt+="○" + } + if(is_entitypage04==1) + { + page_index.txt+="○" + } Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity01_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ●○○○ + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,25 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage04 + page home } // Right to Left swipec2=0-swipedx if(swipec100) { - page entitypage03 + if(is_entitypage04==1) + { + page entitypage04 + }else if(is_entitypage03==1) + { + page entitypage03 + }else if(is_entitypage02==1) + { + page entitypage02 + }else + { + page home + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - page entitypage04 + if(is_entitypage02==1) // Check if entitypage02 is active + { + if(is_entitypage03==1) // Then check if entitypage03 is also active + { + page entitypage03 // Navigate to entitypage03 if both are active + }else if(is_entitypage04==1) // If entitypage03 is not active, but entitypage04 is + { + page entitypage04 // Navigate to entitypage04, skipping entitypage03 + }else + { + page home // Fallback if neither entitypage03 nor entitypage04 is active + } + }else if(is_entitypage03==1) // If entitypage02 is not active, check entitypage03 directly + { + if(is_entitypage04==1) // Check if entitypage04 is active + { + page entitypage04 // Navigate to entitypage04, 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/entitypage02.txt b/hmi/dev/nspanel_us_code/entitypage02.txt index 1ba1ec3..4b25de6 100644 --- a/hmi/dev/nspanel_us_code/entitypage02.txt +++ b/hmi/dev/nspanel_us_code/entitypage02.txt @@ -17,6 +17,19 @@ Page entitypage02 page home } vis unavailable,0 + if(is_entitypage01==1) + { + page_index.txt+="○" + } + page_index.txt+="●" + if(is_entitypage03==1) + { + page_index.txt+="○" + } + if(is_entitypage04==1) + { + page_index.txt+="○" + } Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity02_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○●○○ + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,28 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage01 + if(is_entitypage01==1) + { + page entitypage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_entitypage01==1) + { + page home + }else + { + if(is_entitypage04==1) + { + page entitypage04 + }else if(is_entitypage03==1) + { + page entitypage03 + }else + { + page home + } + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + if(is_entitypage03==1&&is_entitypage04==1) + { + page entitypage04 + }else if(is_entitypage03==1||is_entitypage04==1) + { + page home + }else + { + if(is_entitypage01==1) + { + page entitypage01 + }else + { + page home + } + } } } diff --git a/hmi/dev/nspanel_us_code/entitypage03.txt b/hmi/dev/nspanel_us_code/entitypage03.txt index b343d78..97fecd2 100644 --- a/hmi/dev/nspanel_us_code/entitypage03.txt +++ b/hmi/dev/nspanel_us_code/entitypage03.txt @@ -17,6 +17,19 @@ Page entitypage03 page home } vis unavailable,0 + if(is_entitypage01==1) + { + page_index.txt+="○" + } + if(is_entitypage02==1) + { + page_index.txt+="○" + } + page_index.txt+="●" + if(is_entitypage04==1) + { + page_index.txt+="○" + } Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity03_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○○●○ + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,28 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage02 + if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage01==1) + { + page entitypage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_entitypage02==1&&is_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1||is_entitypage01==1||is_entitypage04==0) + { + page home + }else + { + page entitypage04 + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - page entitypage01 + if(is_entitypage04==1) + { + page home + }else if(is_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1) + { + page entitypage02 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_us_code/entitypage04.txt b/hmi/dev/nspanel_us_code/entitypage04.txt index e8e84f8..a7c0222 100644 --- a/hmi/dev/nspanel_us_code/entitypage04.txt +++ b/hmi/dev/nspanel_us_code/entitypage04.txt @@ -17,6 +17,19 @@ Page entitypage04 page home } vis unavailable,0 + if(is_entitypage01==1) + { + page_index.txt+="○" + } + if(is_entitypage02==1) + { + page_index.txt+="○" + } + if(is_entitypage03==1) + { + page_index.txt+="○" + } + page_index.txt+="●" Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity04_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○○○● + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,26 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage03 + // Navigate back based on active status + if(is_entitypage03==1) + { + page entitypage03 + }else if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage01==1) + { + page entitypage01 + }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 entitypage01 + if(is_entitypage03==1&&is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage03==1||is_entitypage02==1) + { + if(is_entitypage01==1) + { + page entitypage01 + }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_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage03==1) + { + page entitypage03 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_us_code/home.txt b/hmi/dev/nspanel_us_code/home.txt index 43044a3..e8109d7 100644 --- a/hmi/dev/nspanel_us_code/home.txt +++ b/hmi/dev/nspanel_us_code/home.txt @@ -686,15 +686,47 @@ TouchCap swipe { swipec=swipex-tch2 // From Left to Right - if(swipec>swipedx&&api==1) + if(swipec>swipedx) { - page buttonpage04 + // Navigate back based on active status + if(is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + // Do nothing + } } - // Right to Left + // Right to Left swipe now navigates to home, looping back to the start. swipec2=0-swipedx - if(swipec100&&api==1) + if(swipec>100) { - page buttonpage02 + if(is_buttonpage04==1&&is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage04==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage04==1&&is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage03==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage03==1&&is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage02==1&&is_buttonpage01==1) + { + page buttonpage01 + }else + { + // Do nothing + } } // Down to Up - swipec2=0-swipedy - if(swipec<-100&&api==1) + swipec=0-swipedy + if(swipec<-100) { - page buttonpage03 + // Navigate back up the sequence based on active status + if(is_buttonpage01==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1&&is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage01==1&&is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage02==1&&is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1&&is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1&&is_buttonpage04==1) + { + page buttonpage04 + }else + { + // Do nothing + } } } diff --git a/hmi/dev/nspanel_us_land_code/Program.s.txt b/hmi/dev/nspanel_us_land_code/Program.s.txt index 0c3ab34..a7d1d20 100644 --- a/hmi/dev/nspanel_us_land_code/Program.s.txt +++ b/hmi/dev/nspanel_us_land_code/Program.s.txt @@ -4,6 +4,8 @@ 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 is_entitypage01=1, is_entitypage02=1, is_entitypage03=1, is_entitypage04=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_land_code/buttonpage01.txt b/hmi/dev/nspanel_us_land_code/buttonpage01.txt index 56fb3a3..2026b19 100644 --- a/hmi/dev/nspanel_us_land_code/buttonpage01.txt +++ b/hmi/dev/nspanel_us_land_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_land_code/buttonpage02.txt b/hmi/dev/nspanel_us_land_code/buttonpage02.txt index 72e5fa6..3d479dc 100644 --- a/hmi/dev/nspanel_us_land_code/buttonpage02.txt +++ b/hmi/dev/nspanel_us_land_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_land_code/buttonpage03.txt b/hmi/dev/nspanel_us_land_code/buttonpage03.txt index 1f2a720..ed1c1f0 100644 --- a/hmi/dev/nspanel_us_land_code/buttonpage03.txt +++ b/hmi/dev/nspanel_us_land_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_land_code/buttonpage04.txt b/hmi/dev/nspanel_us_land_code/buttonpage04.txt index a164813..088a871 100644 --- a/hmi/dev/nspanel_us_land_code/buttonpage04.txt +++ b/hmi/dev/nspanel_us_land_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_entitypage03==1) + { + page entitypage03 + }else if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage01==1) + { + page entitypage01 + }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_entitypage03==1&&is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage03==1||is_entitypage02==1) + { + if(is_entitypage01==1) + { + page entitypage01 + }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_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage03==1) + { + page entitypage03 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_us_land_code/entitypage01.txt b/hmi/dev/nspanel_us_land_code/entitypage01.txt index ceb8e33..977a7b4 100644 --- a/hmi/dev/nspanel_us_land_code/entitypage01.txt +++ b/hmi/dev/nspanel_us_land_code/entitypage01.txt @@ -17,6 +17,19 @@ Page entitypage01 page home } vis unavailable,0 + page_index.txt+="●" + if(is_entitypage02==1) + { + page_index.txt+="○" + } + if(is_entitypage03==1) + { + page_index.txt+="○" + } + if(is_entitypage04==1) + { + page_index.txt+="○" + } Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity01_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ●○○○ + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,25 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage04 + page home } // Right to Left swipec2=0-swipedx if(swipec100) { - page entitypage03 + if(is_entitypage04==1) + { + page entitypage04 + }else if(is_entitypage03==1) + { + page entitypage03 + }else if(is_entitypage02==1) + { + page entitypage02 + }else + { + page home + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - page entitypage04 + if(is_entitypage02==1) // Check if entitypage02 is active + { + if(is_entitypage03==1) // Then check if entitypage03 is also active + { + page entitypage03 // Navigate to entitypage03 if both are active + }else if(is_entitypage04==1) // If entitypage03 is not active, but entitypage04 is + { + page entitypage04 // Navigate to entitypage04, skipping entitypage03 + }else + { + page home // Fallback if neither entitypage03 nor entitypage04 is active + } + }else if(is_entitypage03==1) // If entitypage02 is not active, check entitypage03 directly + { + if(is_entitypage04==1) // Check if entitypage04 is active + { + page entitypage04 // Navigate to entitypage04, 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_land_code/entitypage02.txt b/hmi/dev/nspanel_us_land_code/entitypage02.txt index 1ba1ec3..4b25de6 100644 --- a/hmi/dev/nspanel_us_land_code/entitypage02.txt +++ b/hmi/dev/nspanel_us_land_code/entitypage02.txt @@ -17,6 +17,19 @@ Page entitypage02 page home } vis unavailable,0 + if(is_entitypage01==1) + { + page_index.txt+="○" + } + page_index.txt+="●" + if(is_entitypage03==1) + { + page_index.txt+="○" + } + if(is_entitypage04==1) + { + page_index.txt+="○" + } Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity02_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○●○○ + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,28 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage01 + if(is_entitypage01==1) + { + page entitypage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_entitypage01==1) + { + page home + }else + { + if(is_entitypage04==1) + { + page entitypage04 + }else if(is_entitypage03==1) + { + page entitypage03 + }else + { + page home + } + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - //page + if(is_entitypage03==1&&is_entitypage04==1) + { + page entitypage04 + }else if(is_entitypage03==1||is_entitypage04==1) + { + page home + }else + { + if(is_entitypage01==1) + { + page entitypage01 + }else + { + page home + } + } } } diff --git a/hmi/dev/nspanel_us_land_code/entitypage03.txt b/hmi/dev/nspanel_us_land_code/entitypage03.txt index 7286e7d..38e1097 100644 --- a/hmi/dev/nspanel_us_land_code/entitypage03.txt +++ b/hmi/dev/nspanel_us_land_code/entitypage03.txt @@ -17,6 +17,19 @@ Page entitypage03 page home } vis unavailable,0 + if(is_entitypage01==1) + { + page_index.txt+="○" + } + if(is_entitypage02==1) + { + page_index.txt+="○" + } + page_index.txt+="●" + if(is_entitypage04==1) + { + page_index.txt+="○" + } Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity03_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○○●○ + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,28 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage02 + if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage01==1) + { + page entitypage01 + }else + { + page home + } } // Right to Left swipec2=0-swipedx if(swipec100) { - //page + if(is_entitypage02==1&&is_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1||is_entitypage01==1||is_entitypage04==0) + { + page home + }else + { + page entitypage04 + } } // Down to Up - swipec2=0-swipedy + swipec=0-swipedy if(swipec<-100) { - page entitypage01 + if(is_entitypage04==1) + { + page home + }else if(is_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1) + { + page entitypage02 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_us_land_code/entitypage04.txt b/hmi/dev/nspanel_us_land_code/entitypage04.txt index e8e84f8..a7c0222 100644 --- a/hmi/dev/nspanel_us_land_code/entitypage04.txt +++ b/hmi/dev/nspanel_us_land_code/entitypage04.txt @@ -17,6 +17,19 @@ Page entitypage04 page home } vis unavailable,0 + if(is_entitypage01==1) + { + page_index.txt+="○" + } + if(is_entitypage02==1) + { + page_index.txt+="○" + } + if(is_entitypage03==1) + { + page_index.txt+="○" + } + page_index.txt+="●" Postinitialize Event sendme @@ -71,7 +84,7 @@ Text value03_label Text : Max. Text Size : 60 -Text entity04_label +Text page_label Attributes ID : 8 Scope : local @@ -278,7 +291,7 @@ Text page_index Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : ○○○● + Text : Max. Text Size : 12 Text unavailable @@ -359,13 +372,26 @@ TouchCap swipe // From Left to Right if(swipec>swipedx) { - page entitypage03 + // Navigate back based on active status + if(is_entitypage03==1) + { + page entitypage03 + }else if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage01==1) + { + page entitypage01 + }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 entitypage01 + if(is_entitypage03==1&&is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage03==1||is_entitypage02==1) + { + if(is_entitypage01==1) + { + page entitypage01 + }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_entitypage01==1) + { + page entitypage01 + }else if(is_entitypage02==1) + { + page entitypage02 + }else if(is_entitypage03==1) + { + page entitypage03 + }else + { + page home + } } } diff --git a/hmi/dev/nspanel_us_land_code/home.txt b/hmi/dev/nspanel_us_land_code/home.txt index 43044a3..e8109d7 100644 --- a/hmi/dev/nspanel_us_land_code/home.txt +++ b/hmi/dev/nspanel_us_land_code/home.txt @@ -686,15 +686,47 @@ TouchCap swipe { swipec=swipex-tch2 // From Left to Right - if(swipec>swipedx&&api==1) + if(swipec>swipedx) { - page buttonpage04 + // Navigate back based on active status + if(is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1) + { + page buttonpage01 + }else + { + // Do nothing + } } - // Right to Left + // Right to Left swipe now navigates to home, looping back to the start. swipec2=0-swipedx - if(swipec100&&api==1) + if(swipec>100) { - page buttonpage02 + if(is_buttonpage04==1&&is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage04==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage04==1&&is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage03==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage03==1&&is_buttonpage01==1) + { + page buttonpage01 + }else if(is_buttonpage02==1&&is_buttonpage01==1) + { + page buttonpage01 + }else + { + // Do nothing + } } // Down to Up - swipec2=0-swipedy - if(swipec<-100&&api==1) + swipec=0-swipedy + if(swipec<-100) { - page buttonpage03 + // Navigate back up the sequence based on active status + if(is_buttonpage01==1&&is_buttonpage02==1) + { + page buttonpage02 + }else if(is_buttonpage01==1&&is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage01==1&&is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage02==1&&is_buttonpage03==1) + { + page buttonpage03 + }else if(is_buttonpage02==1&&is_buttonpage04==1) + { + page buttonpage04 + }else if(is_buttonpage03==1&&is_buttonpage04==1) + { + page buttonpage04 + }else + { + // Do nothing + } } } diff --git a/hmi/nspanel_eu.HMI b/hmi/nspanel_eu.HMI index cd3549e..5aa32b6 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 77cfb9f..43df656 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 1d7e538..53292fb 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 2ca5d3a..5349eba 100644 Binary files a/hmi/nspanel_us.tft and b/hmi/nspanel_us.tft differ diff --git a/hmi/nspanel_us_land.HMI b/hmi/nspanel_us_land.HMI index 7c94231..ee1da1f 100644 Binary files a/hmi/nspanel_us_land.HMI and b/hmi/nspanel_us_land.HMI differ diff --git a/hmi/nspanel_us_land.tft b/hmi/nspanel_us_land.tft index c83d8e4..2f125d2 100644 Binary files a/hmi/nspanel_us_land.tft and b/hmi/nspanel_us_land.tft differ diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 3a08abb..dd52305 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -6292,6 +6292,175 @@ variables: page: buttonpage04 component: button08 + ##### Entity pages ##### + entities_pages: + labels: + entitypage01: !input 'entity_page01_label' + entitypage02: !input 'entity_page02_label' + entitypage03: !input 'entity_page03_label' + entitypage04: !input 'entity_page04_label' + entities: + - entity: !input 'entities_entity01' + name: !input 'entities_entity01_name' + icon: !input 'entities_entity01_icon' + page: entitypage01 + component: value01 + - entity: !input 'entities_entity02' + name: !input 'entities_entity02_name' + icon: !input 'entities_entity02_icon' + page: entitypage01 + component: value02 + - entity: !input 'entities_entity03' + name: !input 'entities_entity03_name' + icon: !input 'entities_entity03_icon' + page: entitypage01 + component: value03 + - entity: !input 'entities_entity04' + name: !input 'entities_entity04_name' + icon: !input 'entities_entity04_icon' + page: entitypage01 + component: value04 + - entity: !input 'entities_entity05' + name: !input 'entities_entity05_name' + icon: !input 'entities_entity05_icon' + page: entitypage01 + component: value05 + - entity: !input 'entities_entity06' + name: !input 'entities_entity06_name' + icon: !input 'entities_entity06_icon' + page: entitypage01 + component: value06 + - entity: !input 'entities_entity07' + name: !input 'entities_entity07_name' + icon: !input 'entities_entity07_icon' + page: entitypage01 + component: value07 + - entity: !input 'entities_entity08' + name: !input 'entities_entity08_name' + icon: !input 'entities_entity08_icon' + page: entitypage01 + component: value08 + - entity: !input 'entities_entity09' + name: !input 'entities_entity09_name' + icon: !input 'entities_entity09_icon' + page: entitypage02 + component: value01 + - entity: !input 'entities_entity10' + name: !input 'entities_entity10_name' + icon: !input 'entities_entity10_icon' + page: entitypage02 + component: value02 + - entity: !input 'entities_entity11' + name: !input 'entities_entity11_name' + icon: !input 'entities_entity11_icon' + page: entitypage02 + component: value03 + - entity: !input 'entities_entity12' + name: !input 'entities_entity12_name' + icon: !input 'entities_entity12_icon' + page: entitypage02 + component: value04 + - entity: !input 'entities_entity13' + name: !input 'entities_entity13_name' + icon: !input 'entities_entity13_icon' + page: entitypage02 + component: value05 + - entity: !input 'entities_entity14' + name: !input 'entities_entity14_name' + icon: !input 'entities_entity14_icon' + page: entitypage02 + component: value06 + - entity: !input 'entities_entity15' + name: !input 'entities_entity15_name' + icon: !input 'entities_entity15_icon' + page: entitypage02 + component: value07 + - entity: !input 'entities_entity16' + name: !input 'entities_entity16_name' + icon: !input 'entities_entity16_icon' + page: entitypage02 + component: value08 + - entity: !input 'entities_entity17' + name: !input 'entities_entity17_name' + icon: !input 'entities_entity17_icon' + page: entitypage03 + component: value01 + - entity: !input 'entities_entity18' + name: !input 'entities_entity18_name' + icon: !input 'entities_entity18_icon' + page: entitypage03 + component: value02 + - entity: !input 'entities_entity19' + name: !input 'entities_entity19_name' + icon: !input 'entities_entity19_icon' + page: entitypage03 + component: value03 + - entity: !input 'entities_entity20' + name: !input 'entities_entity20_name' + icon: !input 'entities_entity20_icon' + page: entitypage03 + component: value04 + - entity: !input 'entities_entity21' + name: !input 'entities_entity21_name' + icon: !input 'entities_entity21_icon' + page: entitypage03 + component: value05 + - entity: !input 'entities_entity22' + name: !input 'entities_entity22_name' + icon: !input 'entities_entity22_icon' + page: entitypage03 + component: value06 + - entity: !input 'entities_entity23' + name: !input 'entities_entity23_name' + icon: !input 'entities_entity23_icon' + page: entitypage03 + component: value07 + - entity: !input 'entities_entity24' + name: !input 'entities_entity24_name' + icon: !input 'entities_entity24_icon' + page: entitypage03 + component: value08 + - entity: !input 'entities_entity25' + name: !input 'entities_entity25_name' + icon: !input 'entities_entity25_icon' + page: entitypage04 + component: value01 + - entity: !input 'entities_entity26' + name: !input 'entities_entity26_name' + icon: !input 'entities_entity26_icon' + page: entitypage04 + component: value02 + - entity: !input 'entities_entity27' + name: !input 'entities_entity27_name' + icon: !input 'entities_entity27_icon' + page: entitypage04 + component: value03 + - entity: !input 'entities_entity28' + name: !input 'entities_entity28_name' + icon: !input 'entities_entity28_icon' + page: entitypage04 + component: value04 + - entity: !input 'entities_entity29' + name: !input 'entities_entity29_name' + icon: !input 'entities_entity29_icon' + page: entitypage04 + component: value05 + - entity: !input 'entities_entity30' + name: !input 'entities_entity30_name' + icon: !input 'entities_entity30_icon' + page: entitypage04 + component: value06 + - entity: !input 'entities_entity31' + name: !input 'entities_entity31_name' + icon: !input 'entities_entity31_icon' + page: entitypage04 + component: value07 + - entity: !input 'entities_entity32' + name: !input 'entities_entity32_name' + icon: !input 'entities_entity32_icon' + page: entitypage04 + component: value08 + ##### WEATHER #### weather_entity_tmp: !input 'weather_entity' # used only during the creation of weather in variables weather_entity: > @@ -7522,6 +7691,25 @@ action: }} continue_on_error: true + - repeat: # Disable empty entity pages + for_each: '{{ page.entitypages }}' + sequence: + - service: '{{ nspanel.service.command }}' + data: + cmd: > + is_{{ repeat.item }}={{ + 1 + if + entities_pages.entities | + 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 @@ -8737,188 +8925,25 @@ action: sequence: &refresh_entity_pages - &variables-entity_pages variables: - ##### Entity pages ##### - entity_pages_labels: - - label: !input 'entity_page01_label' - - label: !input 'entity_page02_label' - - label: !input 'entity_page03_label' - - label: !input 'entity_page04_label' - entity_pages_entities: - - entity: !input 'entities_entity01' - name: !input 'entities_entity01_name' - icon: !input 'entities_entity01_icon' - page: entitypage01 - component: value01 - - entity: !input 'entities_entity02' - name: !input 'entities_entity02_name' - icon: !input 'entities_entity02_icon' - page: entitypage01 - component: value02 - - entity: !input 'entities_entity03' - name: !input 'entities_entity03_name' - icon: !input 'entities_entity03_icon' - page: entitypage01 - component: value03 - - entity: !input 'entities_entity04' - name: !input 'entities_entity04_name' - icon: !input 'entities_entity04_icon' - page: entitypage01 - component: value04 - - entity: !input 'entities_entity05' - name: !input 'entities_entity05_name' - icon: !input 'entities_entity05_icon' - page: entitypage01 - component: value05 - - entity: !input 'entities_entity06' - name: !input 'entities_entity06_name' - icon: !input 'entities_entity06_icon' - page: entitypage01 - component: value06 - - entity: !input 'entities_entity07' - name: !input 'entities_entity07_name' - icon: !input 'entities_entity07_icon' - page: entitypage01 - component: value07 - - entity: !input 'entities_entity08' - name: !input 'entities_entity08_name' - icon: !input 'entities_entity08_icon' - page: entitypage01 - component: value08 - - entity: !input 'entities_entity09' - name: !input 'entities_entity09_name' - icon: !input 'entities_entity09_icon' - page: entitypage02 - component: value01 - - entity: !input 'entities_entity10' - name: !input 'entities_entity10_name' - icon: !input 'entities_entity10_icon' - page: entitypage02 - component: value02 - - entity: !input 'entities_entity11' - name: !input 'entities_entity11_name' - icon: !input 'entities_entity11_icon' - page: entitypage02 - component: value03 - - entity: !input 'entities_entity12' - name: !input 'entities_entity12_name' - icon: !input 'entities_entity12_icon' - page: entitypage02 - component: value04 - - entity: !input 'entities_entity13' - name: !input 'entities_entity13_name' - icon: !input 'entities_entity13_icon' - page: entitypage02 - component: value05 - - entity: !input 'entities_entity14' - name: !input 'entities_entity14_name' - icon: !input 'entities_entity14_icon' - page: entitypage02 - component: value06 - - entity: !input 'entities_entity15' - name: !input 'entities_entity15_name' - icon: !input 'entities_entity15_icon' - page: entitypage02 - component: value07 - - entity: !input 'entities_entity16' - name: !input 'entities_entity16_name' - icon: !input 'entities_entity16_icon' - page: entitypage02 - component: value08 - - entity: !input 'entities_entity17' - name: !input 'entities_entity17_name' - icon: !input 'entities_entity17_icon' - page: entitypage03 - component: value01 - - entity: !input 'entities_entity18' - name: !input 'entities_entity18_name' - icon: !input 'entities_entity18_icon' - page: entitypage03 - component: value02 - - entity: !input 'entities_entity19' - name: !input 'entities_entity19_name' - icon: !input 'entities_entity19_icon' - page: entitypage03 - component: value03 - - entity: !input 'entities_entity20' - name: !input 'entities_entity20_name' - icon: !input 'entities_entity20_icon' - page: entitypage03 - component: value04 - - entity: !input 'entities_entity21' - name: !input 'entities_entity21_name' - icon: !input 'entities_entity21_icon' - page: entitypage03 - component: value05 - - entity: !input 'entities_entity22' - name: !input 'entities_entity22_name' - icon: !input 'entities_entity22_icon' - page: entitypage03 - component: value06 - - entity: !input 'entities_entity23' - name: !input 'entities_entity23_name' - icon: !input 'entities_entity23_icon' - page: entitypage03 - component: value07 - - entity: !input 'entities_entity24' - name: !input 'entities_entity24_name' - icon: !input 'entities_entity24_icon' - page: entitypage03 - component: value08 - - entity: !input 'entities_entity25' - name: !input 'entities_entity25_name' - icon: !input 'entities_entity25_icon' - page: entitypage04 - component: value01 - - entity: !input 'entities_entity26' - name: !input 'entities_entity26_name' - icon: !input 'entities_entity26_icon' - page: entitypage04 - component: value02 - - entity: !input 'entities_entity27' - name: !input 'entities_entity27_name' - icon: !input 'entities_entity27_icon' - page: entitypage04 - component: value03 - - entity: !input 'entities_entity28' - name: !input 'entities_entity28_name' - icon: !input 'entities_entity28_icon' - page: entitypage04 - component: value04 - - entity: !input 'entities_entity29' - name: !input 'entities_entity29_name' - icon: !input 'entities_entity29_icon' - page: entitypage04 - component: value05 - - entity: !input 'entities_entity30' - name: !input 'entities_entity30_name' - icon: !input 'entities_entity30_icon' - page: entitypage04 - component: value06 - - entity: !input 'entities_entity31' - name: !input 'entities_entity31_name' - icon: !input 'entities_entity31_icon' - page: entitypage04 - component: value07 - - entity: !input 'entities_entity32' - name: !input 'entities_entity32_name' - icon: !input 'entities_entity32_icon' - page: entitypage04 - component: value08 - - variables: - entity_page_index: '{{ (nspanel_event.page[-2:] | int(-1)) - 1 }}' - first_entity: '{{ entity_page_index * 8 }}' - last_entity: '{{ first_entity + 8 }}' + event_page: '{{ nspanel_event.page if nspanel_event is defined and nspanel_event.page is defined else page.current }}' ##### Entity page - Label ##### - - if: '{{ entity_pages_labels[entity_page_index].label | length > 0 }}' + - if: '{{ entities_pages.labels[event_page] | length > 0 }}' then: - service: '{{ nspanel.service.component.text }}' data: - id: '{{ "entity%02d_label" | format(entity_page_index + 1) }}' - txt: '{{ entity_pages_labels[entity_page_index].label }}' + id: page_label + txt: '{{ entities_pages.labels[event_page] }}' continue_on_error: true ##### Entities ##### - repeat: - for_each: '{{ entity_pages_entities[first_entity:last_entity] }}' + for_each: > + {{ + entities_pages.entities + | selectattr("page", "defined") + | selectattr("page", "eq", event_page) + | selectattr("entity", "defined") + | list + }} sequence: &update_entity_page_entity - condition: '{{ repeat.item.entity is string and repeat.item.entity | length > 0 }}' - variables: @@ -9917,7 +9942,7 @@ action: - repeat: for_each: > {{ - entity_pages_entities + entities_pages.entities | selectattr("page", "defined") | selectattr("page", "eq", page.current) | selectattr("entity", "defined")