{% extends "base.html" %} {% block title %}{{ battery.label }} — Battery Tracker{% endblock %} {% block content %}

{{ battery.label }}

{% macro meta_row(label, value) %} {% if value %} {{ label }} {{ value }} {% endif %} {% endmacro %}
{{ meta_row("Size", battery.size) }} {{ meta_row("Chemistry", battery.chemistry) }} {% if battery.capacity_mah %} {% elif battery.tested_capacity_mah %} {% endif %} {{ meta_row("Charge Cycles", battery.charge_cycles) }} {{ meta_row("Purchase Date", battery.purchase_date) }} {{ meta_row("Storage", battery.storage_location) }} {% if battery.battery_percentage is not none %} {% endif %} {% if battery.notes %} {% endif %}
Label {{ battery.label }}
Brand {{ battery.brand }}
Status {{ battery.status|capitalize }}
Device {% if battery.device %} {{ battery.device.name }} {% else %} None {% endif %}
Capacity {{ battery.capacity_mah }} mAh {% if battery.tested_capacity_mah %} {% set pct = (battery.tested_capacity_mah / battery.capacity_mah * 100)|round|int %} {% if pct >= 80 %}{% set health_class = "health-good" %} {% elif pct >= 60 %}{% set health_class = "health-warn" %} {% else %}{% set health_class = "health-bad" %} {% endif %} → tested {{ battery.tested_capacity_mah }} mAh ({{ pct }}%) {% if battery.tested_date %}on {{ battery.tested_date }}{% endif %} {% endif %}
Tested Capacity {{ battery.tested_capacity_mah }} mAh {% if battery.tested_date %}on {{ battery.tested_date }}{% endif %}
Battery % {% if battery.battery_percentage < 20 %} ⚠ {{ battery.battery_percentage }}% — consider replacing {% else %} {{ battery.battery_percentage }}% {% endif %}
Notes {{ battery.notes }}

Capacity History

{% if capacity_tests|length >= 2 %} {% endif %} {% set cap_sorted = capacity_tests|sort(attribute='tested_date', reverse=True) %} {% if cap_sorted %} {% set t = cap_sorted[0] %}
{{ t.tested_date }} — {{ t.tested_capacity_mah }} mAh {% if battery.capacity_mah %} {% set pct = (t.tested_capacity_mah / battery.capacity_mah * 100)|round|int %} {% if pct >= 80 %}{% set hc = "health-good" %} {% elif pct >= 60 %}{% set hc = "health-warn" %} {% else %}{% set hc = "health-bad" %}{% endif %} {{ pct }}% {% endif %} {% if t.notes %}— {{ t.notes }}{% endif %} {% if cap_sorted|length > 1 %} {% endif %}
{% else %}

No test records yet.

{% endif %}

Add Test Record

Charge History

{% if charge_logs %} {% set cl = charge_logs[0] %}
{{ cl.charged_date }} {% if cl.increment_cycles %}+cycle{% endif %} {% if cl.notes %}— {{ cl.notes }}{% endif %} {% if charge_logs|length > 1 %} {% endif %}
{% else %}

No charge log entries yet.

{% endif %}

Add Charge Entry

Percentage History

{% if pct_logs|length >= 2 %} {% endif %} {% if pct_logs %} {% set pl = pct_logs[0] %}
{{ pl.recorded_at }} — {% if pl.percentage < 20 %} ⚠ {{ pl.percentage }}% {% else %} {{ pl.percentage }}% {% endif %} {% if pl.source %}{{ pl.source }}{% endif %} {% if pct_logs|length > 1 %} {% endif %}
{% else %}

No percentage history yet.

{% endif %}

Logbook

{% if logbook_entries %}
{% for entry in logbook_entries %}
{{ entry.recorded_at }}
{{ entry.body }}
{% endfor %}
{% else %}

No logbook entries yet.

{% endif %}

Add Entry

Edit Details

Actions

{% if battery.is_available() %} Assign to Device {% endif %} {% if battery.is_installed() %}
{% endif %} {% if not battery.is_retired() %}
{% else %}
{% endif %} Delete Battery
← Back to Dashboard {% endblock %}