From dd2bdacb6d96a3bbfb92c15526b8587545edb8e9 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sat, 19 Nov 2022 22:44:31 +0000 Subject: [PATCH 1/3] add color fields on cardMedia implements #584 (add nextion2text) --- HMI/US/landscape/diff-eu-version.txt | 323 ++++++++++++++++++ HMI/US/landscape/n2t-out-visual/cardMedia.txt | 284 ++++++++++++++- .../n2t-out-visual/nspanel_US_L_Stats.txt | 12 +- HMI/US/landscape/n2t-out/cardMedia.txt | 284 ++++++++++++++- HMI/US/portrait/diff-filtered.txt | 2 +- HMI/US/portrait/n2t-out-visual/cardMedia.txt | 36 +- .../n2t-out-visual/nspanel_US_P_Stats.txt | 12 +- HMI/US/portrait/n2t-out/cardMedia.txt | 36 +- HMI/n2t-out-visual/cardMedia.txt | 36 +- HMI/n2t-out-visual/nspanel_Stats.txt | 8 +- HMI/n2t-out/cardMedia.txt | 36 +- 11 files changed, 982 insertions(+), 87 deletions(-) diff --git a/HMI/US/landscape/diff-eu-version.txt b/HMI/US/landscape/diff-eu-version.txt index 1102c0a7..6a6184bb 100644 --- a/HMI/US/landscape/diff-eu-version.txt +++ b/HMI/US/landscape/diff-eu-version.txt @@ -12,6 +12,329 @@ │ - // fix touch offset │ - lcd_dev fffb 0002 0000 0020 │ - page pageStartup +├── cardMedia.txt +│ @@ -637,14 +637,276 @@ +│ vis bNext,1 +│ bNext.txt="" +│ } +│ //entity name +│ spstr strCommand.txt,entn.txt,"~",3 +│ //icon +│ spstr strCommand.txt,tIcon.txt,"~",4 +│ + //title +│ + spstr strCommand.txt,tTitle.txt,"~",5 +│ + //author +│ + spstr strCommand.txt,tAuthor.txt,"~",6 +│ + //volume +│ + spstr strCommand.txt,tTmp.txt,"~",7 +│ + covx tTmp.txt,sys0,0,0 +│ + hVolume.val=sys0 +│ + //icon +│ + spstr strCommand.txt,tPlayPause.txt,"~",8 +│ + //speaker current +│ + spstr strCommand.txt,tSpeaker.txt,"~",9 +│ + if(tSpeaker.txt!="") +│ + { +│ + tSpeaker.pco=1374 +│ + }else +│ + { +│ + tSpeaker.pco=65535 +│ + } +│ + //speaker list +│ + spstr strCommand.txt,vaSpeakerList.txt,"~",10 +│ + if(vaSpeakerList.txt=="") +│ + { +│ + vis t6,0 +│ + } +│ + vaSpeakerPos.val=0 +│ + // on off button +│ + spstr strCommand.txt,tTmp.txt,"~",11 +│ + if(tTmp.txt=="disable") +│ + { +│ + vis t5,0 +│ + }else +│ + { +│ + vis t5,1 +│ + covx tTmp.txt,t5.pco,0,0 +│ + } +│ + //tIconBtnEntityName +│ + spstr strCommand.txt,vaMenu.txt,"~",12 +│ + } +│ + if(tInstruction.txt=="time") +│ + { +│ + // get set time to global variable +│ + spstr strCommand.txt,pageIcons.vaTime.txt,"~",1 +│ + } +│ + if(tInstruction.txt=="date") +│ + { +│ + // get set date to global variable +│ + spstr strCommand.txt,pageIcons.vaDate.txt,"~",1 +│ + } +│ + if(tInstruction.txt=="dimmode") +│ + { +│ + // get value +│ + spstr strCommand.txt,tTmp.txt,"~",1 +│ + covx tTmp.txt,dimValue,0,0 +│ + // get value normal +│ + spstr strCommand.txt,tTmp.txt,"~",2 +│ + covx tTmp.txt,dimValueNormal,0,0 +│ + dim=dimValueNormal +│ + // get background color +│ + spstr strCommand.txt,tTmp.txt,"~",3 +│ + if(tTmp.txt!="") +│ + { +│ + covx tTmp.txt,defaultBcoColor,0,0 +│ + } +│ + // get font color +│ + spstr strCommand.txt,tTmp.txt,"~",4 +│ + if(tTmp.txt!="") +│ + { +│ + covx tTmp.txt,defaultFontColor,0,0 +│ + } +│ + } +│ + if(tInstruction.txt=="timeout") +│ + { +│ + //set timeout to global var +│ + spstr strCommand.txt,tTmp.txt,"~",1 +│ + covx tTmp.txt,sleepTimeout,0,0 +│ + } +│ + if(tInstruction.txt=="pageType") +│ + { +│ + sleepValue=0 +│ + //command format pageType,specialPageName +│ + //write name of speical page to tId +│ + spstr strCommand.txt,tId.txt,"~",1 +│ + //save second arg if there's one +│ + spstr strCommand.txt,tTmp.txt,"~",2 +│ + //save third arg if there's one +│ + spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3 +│ + spstr strCommand.txt,pageIcons.tTmp3.txt,"~",4 +│ + //we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ... +│ + udelete payloadLength-1 +│ + bufferPos=0 +│ + if(tId.txt=="pageStartup") +│ + { +│ + page pageStartup +│ + } +│ + if(tId.txt=="screensaver") +│ + { +│ + page screensaver +│ + } +│ + if(tId.txt=="cardEntities") +│ + { +│ + page cardEntities +│ + } +│ + if(tId.txt=="cardGrid") +│ + { +│ + page cardGrid +│ + } +│ + if(tId.txt=="popupLight") +│ + { +│ + pageIcons.tTmp1.txt=tTmp.txt +│ + page popupLight +│ + } +│ + if(tId.txt=="popupShutter") +│ + { +│ + pageIcons.tTmp1.txt=tTmp.txt +│ + page popupShutter +│ + } +│ + if(tId.txt=="popupNotify") +│ + { +│ + page popupNotify +│ + } +│ + if(tId.txt=="cardThermo") +│ + { +│ + page cardThermo +│ + } +│ + if(tId.txt=="cardMedia") +│ + { +│ + page cardMedia +│ + } +│ + if(tId.txt=="cardAlarm") +│ + { +│ + page cardAlarm +│ + } +│ + if(tId.txt=="cardQR") +│ + { +│ + page cardQR +│ + } +│ + if(tId.txt=="cardPower") +│ + { +│ + page cardPower +│ + } +│ + } +│ + // end of user code +│ + udelete payloadLength-1 +│ + bufferPos=0 +│ + } +│ + } +│ + } +│ + } +│ + // next character +│ + bufferPos++ +│ + } +│ + if(bufferPos==usize) +│ + { +│ + // copy whole buffer to t1.txt, for debugging +│ + //ucopy t2.txt,0,usize,0 +│ + // ucopy n2.val,0,usize,0 +│ + // clear whole buffer +│ + //code_c +│ + //bufferPos=0 +│ + } +│ + } +│ + +│ +Timer tmSleep +│ + Attributes +│ + Scope : local +│ + Period (ms): 1000 +│ + Enabled : yes +│ + +│ + Events +│ + Timer Event +│ + // data available +│ + if(usize>1) +│ + { +│ + bufferPos=0 +│ + while(bufferPos1) { - sleepValue+=1 - if(sleepTimeout<=sleepValue) + bufferPos=0 + while(bufferPos1) { - sleepValue+=1 - if(sleepTimeout<=sleepValue) + bufferPos=0 + while(bufferPos Date: Mon, 21 Nov 2022 12:06:51 +0100 Subject: [PATCH 2/3] fixes #586 --- apps/nspanel-lovelace-ui/luibackend/pages.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 28e0065f..d5fcc987 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -233,12 +233,13 @@ class LuiPagesGen(object): if entityType == "iText": value = entityId.split(".", 2)[1] name = name if name is not None else "conf name missing" + icon_color = icon_color = rgb_dec565(colorOverride) if colorOverride is not None and type(colorOverride) is list else 17299 icon_res = get_icon_id(icon) if icon is not None else get_icon_id("alert-circle-outline") - return f"~text~{entityId}~{icon_res}~17299~{name}~{value}" + return f"~text~{entityId}~{icon_res}~{icon_color}~{name}~{value}" if entityType == "service": icon_id = get_icon("script", overwrite=icon) text = get_translation(self._locale, "frontend.ui.card.script.run") - icon_color = 17299 + icon_color = icon_color = rgb_dec565(colorOverride) if colorOverride is not None and type(colorOverride) is list else 17299 if item.status is not None and apis.ha_api.entity_exists(item.status): status_entity = apis.ha_api.get_entity(item.status) icon_id = get_icon(item.status.split(".")[0], state=status_entity.state, device_class=status_entity.attributes.get("device_class", "_"), overwrite=icon) From ca721721c97cc942bbd504396c63cd8b48fc3ae6 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Mon, 21 Nov 2022 16:05:47 +0100 Subject: [PATCH 3/3] Update issue-close-app.yml --- .github/issue-close-app.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/issue-close-app.yml b/.github/issue-close-app.yml index 6b66c4d7..3b4abed0 100644 --- a/.github/issue-close-app.yml +++ b/.github/issue-close-app.yml @@ -24,9 +24,9 @@ issueConfigs: - content: # template 1: bug report - "PROBLEM DESCRIPTION" - - "REQUESTED INFORMATION" - - "TO REPRODUCE" - - "EXPECTED BEHAVIOUR" +# - "REQUESTED INFORMATION" +# - "TO REPRODUCE" +# - "EXPECTED BEHAVIOUR" - content: # template 2: feature request - "FEATURE DESCRIPTION"