mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 06:54:24 +01:00
.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||
name: NSPanel Lovelace UI Addon
|
||||
version: "4.7.47"
|
||||
version: "4.7.49"
|
||||
slug: nspanel-lovelace-ui
|
||||
description: NSPanel Lovelace UI Addon
|
||||
services:
|
||||
@@ -18,7 +18,7 @@ map:
|
||||
- addon_config:rw
|
||||
options:
|
||||
loglevel: DEBUG
|
||||
logtofile: true
|
||||
logtofile: false
|
||||
schema:
|
||||
loglevel: list(DEBUG|INFO|WARNING|ERROR|CRITICAL)
|
||||
logtofile: bool
|
||||
|
||||
@@ -25,14 +25,13 @@ class HAEntity(panel_cards.Entity):
|
||||
|
||||
def render(self, cardType=""):
|
||||
|
||||
icon_overwrite = self.icon_overwrite
|
||||
if self.icon_overwrite and self.icon_overwrite.startswith("ha:"):
|
||||
icon_overwrite = libs.home_assistant.get_template(self.icon_overwrite)
|
||||
|
||||
if "icon" in self.config and self.config.get("icon").startswith("ha:"):
|
||||
self.icon_overwrite = libs.home_assistant.get_template(self.config.get("icon"))
|
||||
if "color" in self.config and self.config.get("color").startswith("ha:"):
|
||||
self.color_overwrite = libs.home_assistant.get_template(self.config.get("color"))
|
||||
|
||||
if self.etype in ["delete", "navigate", "iText"]:
|
||||
out = super().render()
|
||||
self.icon_overwrite = icon_overwrite
|
||||
if self.etype == "navigate" and "status" in self.config:
|
||||
status_out = HAEntity(self.locale,
|
||||
{
|
||||
@@ -54,10 +53,10 @@ class HAEntity(panel_cards.Entity):
|
||||
|
||||
# HA Entities
|
||||
entity_type_panel = "text"
|
||||
icon_char = ha_icons.get_icon_ha(self.etype, self.state, device_class=self.attributes.get("device_class", None), media_content_type=self.attributes.get("media_content_type", None), overwrite=icon_overwrite)
|
||||
print(f"xxxx{icon_overwrite} {icon_char}")
|
||||
color = ha_colors.get_entity_color(
|
||||
self.etype, self.state, self.attributes, self.color_overwrite)
|
||||
icon_char = ha_icons.get_icon_ha(self.etype, self.state, device_class=self.attributes.get("device_class", None), media_content_type=self.attributes.get("media_content_type", None), overwrite=self.icon_overwrite)
|
||||
|
||||
color = ha_colors.get_entity_color(self.etype, self.state, self.attributes, self.color_overwrite)
|
||||
|
||||
name = self.config.get("name", self.attributes.get("friendly_name", "unknown"))
|
||||
if self.name_overwrite:
|
||||
name = self.name_overwrite
|
||||
|
||||
Reference in New Issue
Block a user