mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-13 08:28:19 +01:00
.
This commit is contained in:
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -6904,16 +6904,16 @@ icons = {
|
|||||||
def get_icon_id(ma_name):
|
def get_icon_id(ma_name):
|
||||||
if isinstance(ma_name, re.Match):
|
if isinstance(ma_name, re.Match):
|
||||||
ma_name = ma_name.group(0).replace('<I>', '').replace('</I>', '')
|
ma_name = ma_name.group(0).replace('<I>', '').replace('</I>', '')
|
||||||
|
print(f"testxxxx {ma_name}")
|
||||||
|
|
||||||
if "text:" in ma_name:
|
if "text:" in ma_name:
|
||||||
return ma_name.replace("text:", "")
|
return ma_name.replace("text:", "")
|
||||||
# if "ha:" in ma_name:
|
if "<I>" in ma_name and "</I>" in ma_name:
|
||||||
# splitted_string = ma_name.replace("ha:","").rpartition('}')
|
print(f"testdddd {ma_name}")
|
||||||
# template_string = f"{splitted_string[0]}{splitted_string[1]}"
|
if isinstance(ma_name, str):
|
||||||
# templates_result = apis.ha_api.render_template(template_string)
|
ma_name = re.sub(r'<I>.+?<\/I>', get_icon_id, ma_name)
|
||||||
# if isinstance(templates_result, str):
|
print(f"test123d {ma_name}")
|
||||||
# templates_result = re.sub(r"<I>.+?<\/I>", get_icon_id, templates_result)
|
|
||||||
# return f"{templates_result}{splitted_string[2]}"
|
|
||||||
|
|
||||||
ma_name = ma_name.replace("mdi:", "")
|
ma_name = ma_name.replace("mdi:", "")
|
||||||
if ma_name in icons:
|
if ma_name in icons:
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class Entity:
|
|||||||
self.font = font_mapping.get(config.get("font", ""), "")
|
self.font = font_mapping.get(config.get("font", ""), "")
|
||||||
|
|
||||||
def render(self, cardType=""):
|
def render(self, cardType=""):
|
||||||
icon_char = self.icon_overwrite or ""
|
icon_char = self.icon_overwrite or "mdi:gesture-tap-button"
|
||||||
color = rgb_dec565([68, 115, 158])
|
color = rgb_dec565([68, 115, 158])
|
||||||
if self.color_overwrite:
|
if self.color_overwrite:
|
||||||
color = rgb_dec565(self.color_overwrite)
|
color = rgb_dec565(self.color_overwrite)
|
||||||
|
|||||||
Reference in New Issue
Block a user