remove unneeded paramters in weather update

This commit is contained in:
joBr99
2023-02-02 20:29:08 +01:00
parent 7f14e9d205
commit ba6bbeb341
6 changed files with 110 additions and 7 deletions

View File

@@ -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

View File

@@ -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)
{

View File

@@ -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

Binary file not shown.

Binary file not shown.

View File

@@ -141,7 +141,7 @@ 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
@@ -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()