mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 06:27:01 +01:00
remove unneeded paramters in weather update
This commit is contained in:
@@ -246,6 +246,55 @@ if(usize>1)
|
|||||||
covx tTmp.txt,f5Icon.pco,0,0
|
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")
|
if(tInstruction.txt=="notify")
|
||||||
{
|
{
|
||||||
spstr strCommand.txt,tNotifyHead.txt,"~",1
|
spstr strCommand.txt,tNotifyHead.txt,"~",1
|
||||||
|
|||||||
@@ -202,9 +202,7 @@ head = head + """
|
|||||||
covx tTmp.txt,t10.bco,0,0
|
covx tTmp.txt,t10.bco,0,0
|
||||||
spstr strCommand.txt,tTmp.txt,"~",15
|
spstr strCommand.txt,tTmp.txt,"~",15
|
||||||
covx tTmp.txt,tMainTextAlt2.pco,0,0
|
covx tTmp.txt,tMainTextAlt2.pco,0,0
|
||||||
//spstr strCommand.txt,tTmp.txt,"~",16
|
spstr strCommand.txt,tTmp.txt,"~",16
|
||||||
//covx tTmp.txt,tMR.pco,0,0
|
|
||||||
spstr strCommand.txt,tTmp.txt,"~",17
|
|
||||||
covx tTmp.txt,tTimeAdd.pco,0,0
|
covx tTmp.txt,tTimeAdd.pco,0,0
|
||||||
if(tMainTextAlt2.txt!=""&&p0.w!=320)
|
if(tMainTextAlt2.txt!=""&&p0.w!=320)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -126,6 +126,55 @@ for i in range(1,6):
|
|||||||
|
|
||||||
head = head + """
|
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")
|
if(tInstruction.txt=="notify")
|
||||||
{
|
{
|
||||||
spstr strCommand.txt,tNotifyHead.txt,"~",1
|
spstr strCommand.txt,tNotifyHead.txt,"~",1
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -141,7 +141,7 @@ class LuiPagesGen(object):
|
|||||||
|
|
||||||
item_str = ""
|
item_str = ""
|
||||||
for item in entities:
|
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}")
|
self._send_mqtt_msg(f"weatherUpdate{item_str}")
|
||||||
# send color if configured in screensaver
|
# send color if configured in screensaver
|
||||||
@@ -166,7 +166,7 @@ class LuiPagesGen(object):
|
|||||||
altfont += "~"
|
altfont += "~"
|
||||||
self._send_mqtt_msg(f"statusUpdate{status_res}{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
|
entityId = item.entityId
|
||||||
icon = item.iconOverride
|
icon = item.iconOverride
|
||||||
colorOverride = item.colorOverride
|
colorOverride = item.colorOverride
|
||||||
@@ -393,6 +393,12 @@ class LuiPagesGen(object):
|
|||||||
# use uuid instead for some types and probably expand on this in future
|
# use uuid instead for some types and probably expand on this in future
|
||||||
if entityType in ["light"]:
|
if entityType in ["light"]:
|
||||||
entityId = uuid
|
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}"
|
return f"~{entityTypePanel}~{entityId}~{icon_id}~{color}~{name}~{value}"
|
||||||
|
|
||||||
def generate_entities_page(self, navigation, heading, items, cardType, tempUnit):
|
def generate_entities_page(self, navigation, heading, items, cardType, tempUnit):
|
||||||
@@ -608,6 +614,7 @@ class LuiPagesGen(object):
|
|||||||
icon_color = rgb_dec565([243,179,0])
|
icon_color = rgb_dec565([243,179,0])
|
||||||
add_btn=f"{iconnav}~{icon_color}~{entity}"
|
add_btn=f"{iconnav}~{icon_color}~{entity}"
|
||||||
|
|
||||||
|
|
||||||
# add padding to arm buttons
|
# add padding to arm buttons
|
||||||
arm_buttons = ""
|
arm_buttons = ""
|
||||||
for b in supported_modes:
|
for b in supported_modes:
|
||||||
@@ -723,7 +730,7 @@ class LuiPagesGen(object):
|
|||||||
item = card.uuid
|
item = card.uuid
|
||||||
self.generate_unlock_page(navigation, item, card.title, destination, pin)
|
self.generate_unlock_page(navigation, item, card.title, destination, pin)
|
||||||
return
|
return
|
||||||
if card.cardType == "screensaver":
|
if card.cardType in ["screensaver", "screensaver2"]:
|
||||||
theme = card.raw_config.get("theme")
|
theme = card.raw_config.get("theme")
|
||||||
self.update_screensaver_weather(theme)
|
self.update_screensaver_weather(theme)
|
||||||
self.update_status_icons()
|
self.update_status_icons()
|
||||||
|
|||||||
Reference in New Issue
Block a user