mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 16:34:25 +01:00
add status icons
This commit is contained in:
BIN
HMI/fonts/(CJK) HMI NotoSans-Regular 24 (UTF_8).zi
Normal file
BIN
HMI/fonts/(CJK) HMI NotoSans-Regular 24 (UTF_8).zi
Normal file
Binary file not shown.
BIN
HMI/fonts/(CJK) HMI NotoSans-Regular 32 (UTF_8).zi
Normal file
BIN
HMI/fonts/(CJK) HMI NotoSans-Regular 32 (UTF_8).zi
Normal file
Binary file not shown.
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -36,7 +36,7 @@ class Card(object):
|
||||
for e in self.entities:
|
||||
entityIds.append(e.entityId)
|
||||
# additional keys to check
|
||||
add_ent_keys = ['weatherOverrideForecast1', 'weatherOverrideForecast2', 'weatherOverrideForecast3', 'weatherOverrideForecast4']
|
||||
add_ent_keys = ['weatherOverrideForecast1', 'weatherOverrideForecast2', 'weatherOverrideForecast3', 'weatherOverrideForecast4', 'statusIcon1', 'statusIcon2']
|
||||
for ent_key in add_ent_keys:
|
||||
val = self.raw_config.get(ent_key)
|
||||
if val is not None:
|
||||
|
||||
@@ -122,11 +122,23 @@ class LuiPagesGen(object):
|
||||
down = f"{entity.state} {unit_of_measurement}"
|
||||
weather_res+=f"~{up}~{icon}~{down}"
|
||||
|
||||
altLayout = ""
|
||||
altLayout = "~~"
|
||||
if self._config._config_screensaver.raw_config.get("alternativeLayout", False):
|
||||
altLayout = f"~{get_icon_id('water-percent')}~{we.attributes.humidity} %"
|
||||
|
||||
self._send_mqtt_msg(f"weatherUpdate~{icon_cur}~{text_cur}{weather_res}{altLayout}")
|
||||
# status icons
|
||||
status_res = ""
|
||||
for i in range(1,2):
|
||||
statusIcon = self._config._config_screensaver.raw_config.get(f"statusIcon{i}")
|
||||
if statusIcon is not None:
|
||||
icon = statusIcon.get("icon")
|
||||
entity = self._ha_api.get_entity(statusIcon.get("entity"))
|
||||
entityType = entityId.split(".")[0]
|
||||
icon = get_icon_id_ha(entityType, state=entity.state, device_class=entity.attributes.get("device_class", ""), overwrite=icon)
|
||||
color = self.get_entity_color(entity)
|
||||
status_res += f"~{icon}~{color}"
|
||||
|
||||
self._send_mqtt_msg(f"weatherUpdate~{icon_cur}~{text_cur}{weather_res}{altLayout}{status_res}")
|
||||
|
||||
# send color if configured in screensaver
|
||||
if theme is not None:
|
||||
|
||||
Reference in New Issue
Block a user