Repository navigation
Keep UPower's battery rate when sysfs has no live reading - #17265
Merged
Merged
Conversation
Firmware that doesn't know the present rate leaves current_now in place but fails every read of it, so the readable-file check passed, the read came back empty, and the draw showed as 0W. Only take the sysfs reading when it is a number, and otherwise keep UPower's rate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
[Medium impact] The PR appears safe to merge. SummaryKeeps UPower’s battery rate when live readings are unavailable.
Reviews (1) · Last reviewed commit: "Keep UPower's battery rate when sysfs ha..." · Reviewed by Greptile |
omarchybot
added a commit
to calledtoconstruct/omarchy
that referenced
this pull request
Nov 1, 2026
quattro's omacom#17265 rewrote the sysfs rate read to take a value only when it is a number. Keep that, and keep this branch's gate that skips it under DisplayDevice, whose rate already sums every pack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 2, 2026
20 of 34 tasks
berenddeboer
pushed a commit
to berenddeboer/omarchy
that referenced
this pull request
Nov 6, 2026
Firmware that doesn't know the present rate leaves current_now in place but fails every read of it, so the readable-file check passed, the read came back empty, and the draw showed as 0W. Only take the sysfs reading when it is a number, and otherwise keep UPower's rate. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 4761d7b)
This was referenced Nov 13, 2026
4 tasks
omarchybot
added a commit
to mateuseap/omarchy
that referenced
this pull request
Nov 17, 2026
quattro's omacom#17265 added a test for an unreadable current_now at the same spot this branch's cycle-count tests sit. Keep both, cycle-count tests first, since they still rely on CMB0's power_now, which quattro's test removes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
On the XPS 16 (N1x), the battery's firmware reports its present rate as unknown. The kernel still creates
BAT0/current_now, but every read of it fails withENODEV.omarchy-battery-statusonly checked-r, so it read an empty value, worked out a 0W draw, and threw away the rate UPower had already calculated from the falling charge (~11W). As a result the status line and power panel showed no drain rate at all.The script now takes the
power_noworcurrent_now×voltage_nowreading only when the read succeeds and returns a number; otherwise UPower'senergy-ratestands. Machines that report a live reading are unchanged.Battery 90% · 9h 12m left · 98WhBattery 89% · 7h 58m left · 11W / 98WhThe added case in
test/shell.d/battery-status-test.sh(acurrent_nowthat reads back empty) fails onquattroand passes with this change.The underlying gap is the firmware not reporting a present rate, which is worth raising with Dell/NVIDIA separately.
🤖 Generated with Claude Code