{% extends "base.html" %} {% block title %}{{ device.name }} — Battery Tracker{% endblock %} {% block content %} {% if device.parent %}
| Slots | {% if device.has_children() %}{% set ns = namespace(inst=0, slots=0) %}{% for c in device.children %}{% set ns.inst = ns.inst + c.installed_count() %}{% set ns.slots = ns.slots + c.battery_slots %}{% endfor %}{{ ns.inst }} / {{ ns.slots }} (across sub-components){% else %}{{ device.installed_count() }} / {{ device.battery_slots }} used{% endif %} |
| Type | {{ device.device_type }} |
| Battery Size | {{ device.battery_size }} |
| Warning | ⚠ Mixed brands installed |
| Location | {{ device.location }} |
| Type | {{ device.parent.device_type }} (inherited) |
| Location | {{ device.parent.location }} (inherited) |
| Notes | {{ device.notes }} |
| Part of | {{ device.parent.name }} |
| HA Live % | {% if ha_live_pct is not none %} {% if ha_live_pct < 20 %} ⚠ {{ ha_live_pct }}% {% else %} {{ ha_live_pct }}% {% endif %} {% else %} — {% endif %} |
No sub-components. Batteries are tracked at the device level.
{% endif %} + Add Sub-component| Component | Label | Brand | {% if ha_enabled %}Bat % | {% endif %}Last Charged |
|---|---|---|---|---|
| {{ comp_name }} | {{ b.label }} | {{ b.brand }} | {% if ha_enabled %}{% if b.battery_percentage is not none %} {% if b.battery_percentage < 20 %}⚠ {{ b.battery_percentage }}% {% else %}{{ b.battery_percentage }}%{% endif %} {% else %}—{% endif %} | {% endif %}{{ b.charge_logs[-1].charged_date if b.charge_logs else '—' }} |
No batteries installed across sub-components.
{% endif %}{{ free_slots }} slot(s) free{% if device.battery_size %} — showing {{ device.battery_size }} batteries only{% endif %}
| Label | Brand | {% if ha_enabled %}Bat % | {% endif %}Last Charged | Notes | Actions |
|---|---|---|---|---|---|
| {{ b.label }} | {{ b.brand }} | {% if ha_enabled %}{% if b.battery_percentage is not none %} {% if b.battery_percentage < 20 %} ⚠ {{ b.battery_percentage }}% {% else %}{{ b.battery_percentage }}%{% endif %} {% else %}—{% endif %} | {% endif %}{{ b.charge_logs[-1].charged_date if b.charge_logs else '—' }} | {{ b.notes or '—' }} |
No batteries installed.
{% endif %} {% if installed %} {% endif %}No compatible batteries available.
{% endif %}No logbook entries yet.
{% endif %}Deleting this device will unassign all installed batteries and mark them available. {% if device.has_children() %} Sub-components ({{ device.children|map(attribute='name')|join(', ') }}) will become independent devices. {% endif %}