Shows Frame.battery_percent/battery_as_of, already set by every device wake-on-battery report, plus routers/common.py's existing battery_estimate_s time-remaining estimate -- nothing new to fetch or cache. Compact (icon + percent) or detailed (+ estimate, last report age) display mode. No button actions.
24 lines
1.0 KiB
HTML
24 lines
1.0 KiB
HTML
<h2 class="dialog-title">Battery widget</h2>
|
|
|
|
<section class="card">
|
|
<h2 class="card-title">Settings</h2>
|
|
<p class="sub">Shows this frame's own last-reported battery level --
|
|
nothing to configure beyond how much detail to show.</p>
|
|
<form id="battery-config-form">
|
|
<label>Display mode
|
|
<select id="battery_mode">
|
|
<option value="compact" {% if battery_cfg and battery_cfg.mode == 'compact' %}selected{% endif %}>Compact (icon + percent only)</option>
|
|
<option value="detailed" {% if not battery_cfg or battery_cfg.mode == 'detailed' %}selected{% endif %}>Detailed (+ estimated time left, last report)</option>
|
|
</select>
|
|
</label>
|
|
<button type="submit">Save</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="card" style="margin-top: 20px;">
|
|
<h2 class="card-title">Preview</h2>
|
|
<p class="sub">How this widget currently renders.</p>
|
|
<img class="preview-img" id="battery-preview" alt="Battery widget preview">
|
|
<button type="button" class="secondary" id="battery-preview-refresh">Refresh now</button>
|
|
</section>
|