From d00695cd5135daad7988564e037675a38f0d3e5e Mon Sep 17 00:00:00 2001 From: Darek Date: Tue, 14 Apr 2026 01:55:29 -0500 Subject: [PATCH] Device detail UI cleanup: battery icon, HA live % unknown state, remove redundant entity row --- templates/device_detail.html | 41 +++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/templates/device_detail.html b/templates/device_detail.html index 85069a7..5be7dfa 100644 --- a/templates/device_detail.html +++ b/templates/device_detail.html @@ -4,7 +4,30 @@ {% block content %}

{{ device.name }}

-
+
+{% if ha_enabled and device.ha_entity_id and ha_live_pct is not none %} +{% set _pct = ha_live_pct %} +{% set _fill = ((_pct / 100) * 48) | int %} +{% if _pct < 20 %}{% set _color = '#ef4444' %} +{% elif _pct < 60 %}{% set _color = '#f59e0b' %} +{% else %}{% set _color = '#22c55e' %}{% endif %} +
+ + + + {% if _fill > 0 %} + + {% endif %} + {{ _pct }}% + +
+{% endif %} @@ -29,23 +52,21 @@ {% endif %} {% if ha_enabled and device.ha_entity_id %} - - - - - {% if ha_live_pct is not none %} {% endif %} - {% endif %}
Slots
HA Entity{{ device.ha_entity_id }}
HA Live % - {% if ha_live_pct < 20 %} - ⚠ {{ ha_live_pct }}% + {% if ha_live_pct is not none %} + {% if ha_live_pct < 20 %} + ⚠ {{ ha_live_pct }}% + {% else %} + {{ ha_live_pct }}% + {% endif %} {% else %} - {{ ha_live_pct }}% + {% endif %}