Exclude retired batteries from dashboard warnings
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
<div class="text-muted">Retired</div>
|
||||
</div>
|
||||
{% if ha_enabled %}
|
||||
{% set low_pct = batteries | selectattr('battery_percentage', 'ne', none) | selectattr('battery_percentage', 'lt', 20) | list %}
|
||||
{% set low_pct = batteries | rejectattr('status', 'equalto', 'retired') | selectattr('battery_percentage', 'ne', none) | selectattr('battery_percentage', 'lt', 20) | list %}
|
||||
{% if low_pct %}
|
||||
<a href="#needs-attention"
|
||||
onclick="var d=document.getElementById('needs-attention');d.open=true;"
|
||||
@@ -248,7 +248,7 @@
|
||||
<td data-label="Bat %" class="col-ha-pct" style="display:none;"
|
||||
data-sort-col="ha-pct" data-sort="{{ b.battery_percentage if b.battery_percentage is not none else '' }}">
|
||||
{% if b.battery_percentage is not none %}
|
||||
{% if b.battery_percentage < 20 %}
|
||||
{% if b.battery_percentage < 20 and b.status != 'retired' %}
|
||||
<span class="badge badge-warning" title="Low — consider replacing">⚠ {{ b.battery_percentage }}%</span>
|
||||
{% else %}{{ b.battery_percentage }}%{% endif %}
|
||||
{% else %}—{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user