diff --git a/HMI/code_gen/pages/out.txt b/HMI/code_gen/pages/out.txt index d0a5f85e..fcffd81e 100644 --- a/HMI/code_gen/pages/out.txt +++ b/HMI/code_gen/pages/out.txt @@ -246,6 +246,55 @@ if(usize>1) covx tTmp.txt,f5Icon.pco,0,0 } + + if(tInstruction.txt=="color"&&tNotifyHead.txt==""&&tNotifyText.txt=="") + { + spstr strCommand.txt,tTmp.txt,"~",1 + covx tTmp.txt,tTime.bco,0,0 + if(tTime.bco!=screensaver.bco) + { + for(sys0=0;sys0<60;sys0++) + { + if(b[sys0].type==98||b[sys0].type==116||b[sys0].type==54) + { + b[sys0].bco=tTime.bco + } + } + } + spstr strCommand.txt,tTmp.txt,"~",2 + covx tTmp.txt,tTime.pco,0,0 + spstr strCommand.txt,tTmp.txt,"~",3 + covx tTmp.txt,tAMPM.pco,0,0 + spstr strCommand.txt,tTmp.txt,"~",4 + covx tTmp.txt,tDate.pco,0,0 + spstr strCommand.txt,tTmp.txt,"~",5 + covx tTmp.txt,tMainText.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",6 + //covx tTmp.txt,tForecast1.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",7 + //covx tTmp.txt,tForecast2.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",8 + //covx tTmp.txt,tForecast3.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",9 + //covx tTmp.txt,tForecast4.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",10 + //covx tTmp.txt,tForecast1Val.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",11 + //covx tTmp.txt,tForecast2Val.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",12 + //covx tTmp.txt,tForecast3Val.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",13 + //covx tTmp.txt,tForecast4Val.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",14 + //covx tTmp.txt,t10.bco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",15 + //covx tTmp.txt,tMainTextAlt2.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",16 + //covx tTmp.txt,tTimeAdd.pco,0,0 + } + + + if(tInstruction.txt=="notify") { spstr strCommand.txt,tNotifyHead.txt,"~",1 diff --git a/HMI/code_gen/pages/screensaver.py b/HMI/code_gen/pages/screensaver.py index e8bb24ca..a391792c 100644 --- a/HMI/code_gen/pages/screensaver.py +++ b/HMI/code_gen/pages/screensaver.py @@ -202,9 +202,7 @@ head = head + """ covx tTmp.txt,t10.bco,0,0 spstr strCommand.txt,tTmp.txt,"~",15 covx tTmp.txt,tMainTextAlt2.pco,0,0 - //spstr strCommand.txt,tTmp.txt,"~",16 - //covx tTmp.txt,tMR.pco,0,0 - spstr strCommand.txt,tTmp.txt,"~",17 + spstr strCommand.txt,tTmp.txt,"~",16 covx tTmp.txt,tTimeAdd.pco,0,0 if(tMainTextAlt2.txt!=""&&p0.w!=320) { diff --git a/HMI/code_gen/pages/screensaver2.py b/HMI/code_gen/pages/screensaver2.py index 7b61c929..0bf92912 100644 --- a/HMI/code_gen/pages/screensaver2.py +++ b/HMI/code_gen/pages/screensaver2.py @@ -126,6 +126,55 @@ for i in range(1,6): head = head + """ } + + if(tInstruction.txt=="color"&&tNotifyHead.txt==""&&tNotifyText.txt=="") + { + spstr strCommand.txt,tTmp.txt,"~",1 + covx tTmp.txt,tTime.bco,0,0 + if(tTime.bco!=screensaver.bco) + { + for(sys0=0;sys0<60;sys0++) + { + if(b[sys0].type==98||b[sys0].type==116||b[sys0].type==54) + { + b[sys0].bco=tTime.bco + } + } + } + spstr strCommand.txt,tTmp.txt,"~",2 + covx tTmp.txt,tTime.pco,0,0 + spstr strCommand.txt,tTmp.txt,"~",3 + covx tTmp.txt,tAMPM.pco,0,0 + spstr strCommand.txt,tTmp.txt,"~",4 + covx tTmp.txt,tDate.pco,0,0 + spstr strCommand.txt,tTmp.txt,"~",5 + covx tTmp.txt,tMainText.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",6 + //covx tTmp.txt,tForecast1.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",7 + //covx tTmp.txt,tForecast2.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",8 + //covx tTmp.txt,tForecast3.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",9 + //covx tTmp.txt,tForecast4.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",10 + //covx tTmp.txt,tForecast1Val.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",11 + //covx tTmp.txt,tForecast2Val.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",12 + //covx tTmp.txt,tForecast3Val.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",13 + //covx tTmp.txt,tForecast4Val.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",14 + //covx tTmp.txt,t10.bco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",15 + //covx tTmp.txt,tMainTextAlt2.pco,0,0 + //spstr strCommand.txt,tTmp.txt,"~",16 + //covx tTmp.txt,tTimeAdd.pco,0,0 + } + + + if(tInstruction.txt=="notify") { spstr strCommand.txt,tNotifyHead.txt,"~",1 diff --git a/HMI/nspanel.HMI b/HMI/nspanel.HMI index 1fc77f71..04dcbeb7 100644 Binary files a/HMI/nspanel.HMI and b/HMI/nspanel.HMI differ diff --git a/HMI/nspanel.tft b/HMI/nspanel.tft index 55d7bf53..32443579 100644 Binary files a/HMI/nspanel.tft and b/HMI/nspanel.tft differ diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 06c3a56e..954bbcb6 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -141,8 +141,8 @@ class LuiPagesGen(object): item_str = "" for item in entities: - item_str += self.generate_entities_item(item, "cardEntities") - + item_str += self.generate_entities_item(item, "cardEntities", mask=["type", "entityId"]) + self._send_mqtt_msg(f"weatherUpdate{item_str}") # send color if configured in screensaver if theme is not None: @@ -166,7 +166,7 @@ class LuiPagesGen(object): altfont += "~" self._send_mqtt_msg(f"statusUpdate{status_res}{altfont}") - def generate_entities_item(self, item, cardType="cardGrid", temp_unit=""): + def generate_entities_item(self, item, cardType="cardGrid", temp_unit="", mask=None): entityId = item.entityId icon = item.iconOverride colorOverride = item.colorOverride @@ -393,6 +393,12 @@ class LuiPagesGen(object): # use uuid instead for some types and probably expand on this in future if entityType in ["light"]: entityId = uuid + # remove stuff defined in mask + if mask is not None: + if "type" in mask: + entityTypePanel = "" + if "entityId" in mask: + entityId = "" return f"~{entityTypePanel}~{entityId}~{icon_id}~{color}~{name}~{value}" def generate_entities_page(self, navigation, heading, items, cardType, tempUnit): @@ -608,6 +614,7 @@ class LuiPagesGen(object): icon_color = rgb_dec565([243,179,0]) add_btn=f"{iconnav}~{icon_color}~{entity}" + # add padding to arm buttons arm_buttons = "" for b in supported_modes: @@ -723,7 +730,7 @@ class LuiPagesGen(object): item = card.uuid self.generate_unlock_page(navigation, item, card.title, destination, pin) return - if card.cardType == "screensaver": + if card.cardType in ["screensaver", "screensaver2"]: theme = card.raw_config.get("theme") self.update_screensaver_weather(theme) self.update_status_icons()