Repository navigation
Conversation
[Medium impact] The PR appears safe to merge. SummaryThe PR aligns battery readings across the power popup and bar.
No actionable issues were found.
|
|
Read the diff at No tests ran and no code changed. This is waiting for classification to be resolved before worker verification. |
|
Classification is now agreed as a bug. Codex High (GPT-6) compared this head, This carries additional work worth preserving from @blankdean: empty/absent-pack filtering, keeping sysfs metadata on the selected usable pack, validating cycle counts, and binding the hero percentage to the same live value as the bar. I queued these improvements and their regression cases for #10392's own session to fold in with author credit. #13292 also covers phantom-pack selection, and #12058 covers script percentage rounding; those overlaps need to remain accounted for. Whether to omit thresholds and cycles on multi-pack machines remains a maintainer decision. No tests ran and no code changed in this pass, because #10392 was selected as the competing fix to bring forward. This pull request remains open and waits on the maintainer. |
A removed pack may remain in UPower enumeration with power supply: yes. Counting it switches a single present pack to DisplayDevice and takes cycle counts and charge limits from the removed slot. Skip candidates explicitly marked absent, preserving the live sysfs path and metadata for the remaining pack. This carries the absent-pack check from omacom#17639 without changing the first-pack metadata policy or dropping zero-capacity packs. Co-Authored-By: Dean Blank <blankdean@gmail.com> Co-Authored-By: GPT-6 in Codex (effort unspecified) <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
What changes
Fix the power popup showing 0% while its icon and progress bar show a charged battery on multi-battery laptops.
On a ThinkPad X270, the internal BAT0 reports zero full capacity while the removable BAT1 is charged. The status command selected the first system battery; the icon and progress bar already use UPower's combined DisplayDevice.
Use DisplayDevice for combined battery readings and bind the popup percentage to the same live reading as its progress bar. Keep instantaneous kernel power readings and charge-limit calculations for one usable pack. With multiple packs, use UPower's combined rate and time estimate, and omit ambiguous per-pack cycle counts and thresholds. Ignore absent packs and firmware slots reporting zero full capacity.
No new dependencies, polling, or model-specific rules. The X270 is verified hardware; other machines with the same first-pack selection problem should benefit too.
Verification
Screenshots
UPower documents DisplayDevice as the composite source for desktop status displays: https://upower.freedesktop.org/docs/UPower.html#UPower.GetDisplayDevice