mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-10 15:26:36 +01:00
Implement alternative font size for status icons
This commit is contained in:
@@ -179,18 +179,19 @@ class LuiPagesGen(object):
|
|||||||
|
|
||||||
# status icons
|
# status icons
|
||||||
status_res = ""
|
status_res = ""
|
||||||
|
altfont = ""
|
||||||
for i in range(1,3):
|
for i in range(1,3):
|
||||||
statusIcon = self._config._config_screensaver.raw_config.get(f"statusIcon{i}")
|
statusIcon = self._config._config_screensaver.raw_config.get(f"statusIcon{i}")
|
||||||
if statusIcon is not None and apis.ha_api.entity_exists(statusIcon.get("entity","")):
|
if statusIcon is not None and apis.ha_api.entity_exists(statusIcon.get("entity","")):
|
||||||
icon = statusIcon.get("icon")
|
icon = statusIcon.get("icon")
|
||||||
entity = apis.ha_api.get_entity(statusIcon.get("entity"))
|
entity = apis.ha_api.get_entity(statusIcon.get("entity"))
|
||||||
entityType = statusIcon.get("entity").split(".")[0]
|
entityType = statusIcon.get("entity").split(".")[0]
|
||||||
icon = get_icon_ha(statusIcon.get("entity"), overwrite=icon)
|
icon = get_icon(entityType, state=entity.state, device_class=entity.attributes.get("device_class", ""), overwrite=icon)
|
||||||
color = self.get_entity_color(entity, ha_type=entityType, overwrite=statusIcon.get("color", None))
|
color = self.get_entity_color(entity, ha_type=entityType, overwrite=statusIcon.get("color", None))
|
||||||
status_res += f"~{icon}~{color}"
|
status_res += f"~{icon}~{color}"
|
||||||
|
altfont += f'~{statusIcon.get("altFont", "")}'
|
||||||
|
|
||||||
self._send_mqtt_msg(f"weatherUpdate~{icon_cur}~{text_cur}{weather_res}{altLayout}{status_res}")
|
self._send_mqtt_msg(f"weatherUpdate~{icon_cur}~{text_cur}{weather_res}{altLayout}{status_res}{altfont}")
|
||||||
|
|
||||||
# send color if configured in screensaver
|
# send color if configured in screensaver
|
||||||
if theme is not None:
|
if theme is not None:
|
||||||
if not ("autoWeather" in theme and theme["autoWeather"]):
|
if not ("autoWeather" in theme and theme["autoWeather"]):
|
||||||
|
|||||||
Reference in New Issue
Block a user