implement value override on cardpower

This commit is contained in:
Johannes Braun
2023-01-29 23:14:20 +01:00
parent 735d017353
commit f59daec50e

View File

@@ -635,7 +635,12 @@ class LuiPagesGen(object):
speed = str(item.entity_input_config.get("speed", 1))
speed = apis.ha_api.render_template(speed)
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":
command += f"~~~~"
else: