Track battery percentage history; skip poll write when value unchanged
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user