Repository navigation
Conversation
tozes
force-pushed
the
plugin/battery-log
branch
from
October 10, 2026 07:20
b4ccc02 to
89164ad
Compare
`battery_log: true` in the gadget platform's `extra` keeps each device's battery readings in a CSV under the plugin's data directory (plugin-data/gadget/battery/<device>.csv): time, unix seconds, battery millivolts, percent, charging, external power and battery present. A row every 30 s, and at once when charging or USB power changes; rows only when a reading has a voltage or percent. Device ids are sanitized for file names, and a file rolls over to <device>.1.csv at 8 MB. Off by default. It exists to calibrate a board's battery percentage from a full discharge. Tests: test_plugin_units.py (rows and rollover), test_adapter_hermes.py (only when enabled, only state readings).
tozes
force-pushed
the
plugin/battery-log
branch
from
October 10, 2026 07:40
89164ad to
2fc4548
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
battery_log: truein the gadget platform'sextrakeeps each device's battery readings in a CSV under the plugin's data directory (plugin-data/gadget/battery/<device>.csv): time, unix seconds, millivolts, percent, charging, external power and battery present. A row every 30 s and at once when charging or USB power changes, only for readings with a voltage or percent. Device ids are sanitized for file names, and a file rolls over to<device>.1.csvat 8 MB. Off by default.It exists to calibrate a board's battery percentage from a full discharge, which is how the AMOLED-1.75C's curves were measured.
Part of a series for the AMOLED-1.75C; the physical report is #103.
How you know it works
Tests on this branch (based on
8069101):hermes-gadget build-sim --test: core 121/121.tests/test_plugin_units.py(rows, rollover) andtests/test_adapter_hermes.py(only when enabled, only state readings), the latter run against Hermes v0.21.6.pytestwithout the simulator-window tests (no virtual display here): 271 passed, 31 skipped.In use: enabled on a Hermes gateway logging the 1.75C since 2026-10-08 20:02, about 1,500 rows so far across a full discharge and several charges.
Documentation and sources
docs/hermes-integration.md(config example and a paragraph) and a changelog line under### Hermes plugin.Checklist