Repository navigation
Conversation
UPower's composite DisplayDevice sums every present pack's advertised energy-full, so a dead T460s pack reporting 0V/0Wh but old energy_full drags the panel to 49% / 10h-to-full while the live pack sits near full (omacom#7916). Split packs by electrical liveness (voltage, stored energy, or current — never energy_full) and rebuild percentage, capacity, and time from the live packs. Per-pack cycle counts and scope=Device exclusion included. Watt-sum loop deliberately deferred to a later micro-PR. Co-authored-by: geirolafs <geirolafs@users.noreply.github.com>
|
Noting an overlap for when this gets rebased: #13292 (open) also changes how |
[Medium impact] The PR appears safe to merge; the previous bounds issue is fixed and no new actionable issues were found. SummaryThe PR rebuilds battery figures from live packs when a dead pack distorts the combined readings.
Reviews (2) · Last reviewed commit: "Cap a live pack's energy at its full whe..." · Reviewed by Greptile |
|
Reviewed at 3fc484a. The problem is real, and this is the approach that fixes #7916. It can't be verified for merge yet: it conflicts with What was checked. I ran a reproduction of the T460s readings from #7916 (dead BAT0 at 0 V and 0 Wh stored but still advertising 20.65 Wh full, live BAT1 at 20.4/20.94 Wh, charging at 2.2 W) on a disposable Omarchy worker, against three scripts:
So #10392 alone leaves #7916 wrong, and this change fixes it. Compared with #13292. It picks the first BAT with a nonzero Defects at this head, verified against the source. Each still matters after the rebase:
What the rebase needs to keep from
Second opinion. It came from Codex Medium and muse-wonder via pi (thinking high). Both agreed the problem is real, that #10392 and #13292 each leave the #7916 case wrong, and that this PR should win over #13292. The first review was by Claude Opus 5.5 in Claude Code, and their agreement isn't guaranteed independent of it. They raised the low-rate, missing-DisplayDevice and sparse-telemetry findings above, and I checked each against the source. What happens next. This waits on the maintainer to decide on #10392. Once that lands, it's on you to rebase onto |
energy_now and energy_full are read separately, so a capacity update in between can leave a pack reporting more than its full, which showed a negative time to full while charging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed again at bd8fcb7. The new commit fixes the out-of-bounds figures from the last review. The rest of that review still stands, and the branch still conflicts with What was checked. The new commit was read, not run. Still open from the last review, unchanged at this head:
Second opinion. Codex Medium and muse-wonder via pi (thinking high) reviewed the new commit. Both agreed the cap is correct and proportionate and that the points above still stand. That agreement isn't guaranteed independent of the first review, which was by Claude Opus 5.5 in Claude Code. They were the ones who noticed the Classification. This round, the two models classifying the PR disagreed. I read it as a bug fix, because it corrects the wrong figures from #7916. Codex Medium read it as an enhancement. Only an agreement counts, so no class label was added at this head. What happens next. This waits on the maintainer, both to decide on #10392 and to settle the classification. Once #10392 lands, it's on you to rebase onto |
Draft, stacked on #10392 — please review after #10392 + #12649 land, then I will rebase.
Rationale: #6845 was closed as a dup of #10392, but #10392 only switches headlines to
DisplayDevicewhen >1 pack. That inherits the #7916 lie: a dead T460s pack reporting0V / 0Wh storedbut its oldenergy_full=20.65Whdrags DisplayDevice to49% / 9.6h-to-fullwhile the live 20.94Wh pack sits near full. This draft ports only thecbe0705liveness layer from #6845 (by @geirolafs, reported by @hilather), adapted to #10392's conditional-DisplayDevice structure.Scope (thin by design):
voltage_now/energy_now/charge_now/current_now/power_now != 0— neverenergy_full, no Support multi-battery laptops via UPower DisplayDevice in omarchy-battery-status #11750present:yesgate per @calledtoconstruct.percentage/capacity/timefrom live packs when a dead pack was excluded; charge-counter-only firmware keeps aggregate values.cycles(42 / 79,-1fails digit check),scope=Deviceperipheral exclusion, thresholds still from firstBAT*.ratehere stays on UPower's aggregate (same as Report combined battery percentage from UPower DisplayDevice #10392).Tests: new
battery-status-dual-battery-test.sh— dead-first T480 shape, two-live cycles7 / 5, T460s #7916 numbers (97%,20Wh,14m). Existingbattery-status-test.shgreen (added missingtypefixture).Fixes #7916 (script side; Panel.qml glyph side was #7917).
Extracted from #6845.