mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-14 00:48:17 +01:00
implement value override on cardpower
This commit is contained in:
@@ -635,7 +635,12 @@ class LuiPagesGen(object):
|
|||||||
speed = str(item.entity_input_config.get("speed", 1))
|
speed = str(item.entity_input_config.get("speed", 1))
|
||||||
speed = apis.ha_api.render_template(speed)
|
speed = apis.ha_api.render_template(speed)
|
||||||
unit = get_attr_safe(entity, "unit_of_measurement", "")
|
unit = get_attr_safe(entity, "unit_of_measurement", "")
|
||||||
command += f"~{icon_color}~{icon}~{speed}~{entity.state} {unit}"
|
value = f"{entity.state} {unit}"
|
||||||
|
# Overwrite for value
|
||||||
|
ovalue = item.value
|
||||||
|
if ovalue is not None:
|
||||||
|
value = apis.ha_api.render_template(ovalue)
|
||||||
|
command += f"~{icon_color}~{icon}~{speed}~{value}"
|
||||||
elif item.entityId == "delete":
|
elif item.entityId == "delete":
|
||||||
command += f"~~~~"
|
command += f"~~~~"
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user