Track battery percentage history; skip poll write when value unchanged

This commit is contained in:
2026-04-13 21:15:19 -05:00
parent 279a1f3f3e
commit d7ba64a2f3
6 changed files with 230 additions and 7 deletions
+31
View File
@@ -220,6 +220,37 @@
</form>
</div>
<!-- Percentage History -->
<div class="card">
<h2>Percentage History</h2>
{% if pct_logs %}
<div class="table-wrap">
<table class="responsive-table">
<thead>
<tr><th>Date / Time</th><th>%</th><th>Source</th></tr>
</thead>
<tbody>
{% for entry in pct_logs %}
<tr>
<td data-label="Date / Time">{{ entry.recorded_at }}</td>
<td data-label="%">
{% if entry.percentage < 20 %}
<span class="badge badge-warning">⚠ {{ entry.percentage }}%</span>
{% else %}
{{ entry.percentage }}%
{% endif %}
</td>
<td data-label="Source" class="text-muted">{{ entry.source or '—' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="text-muted" style="margin-bottom:0;">No percentage history yet.</p>
{% endif %}
</div>
<!-- Edit Details -->
<div class="card">
<h2>Edit Details</h2>