Skip to content

Work out battery time left from the draw shown beside it - #15285

Merged
dhh merged 2 commits into
quattrofrom
battery-time-from-draw
Oct 13, 2026
Merged

dhh merged 2 commits into
quattrofrom
battery-time-from-draw

Conversation

@dhh

@dhh dhh commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

The battery status showed the instantaneous draw from sysfs next to UPower's time left, which averages the draw over a while. After a burst of load the two disagreed, e.g. 1h 42m left · ↓5.5W with 20Wh in the battery.

Time left is now the energy left divided by the same draw shown beside it, so the two always agree. Charging counts up to the charge limit rather than a full battery. UPower's estimate still stands in when the readings for the sum are missing or the draw is negligible.

The time now moves with the live draw, so a short spike shows a shorter time for that moment.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are fixed.

Summary

Battery time now follows the live draw shown beside it. Charging time counts up to the battery's charge limit.

  • Battery time left follows the live draw shown beside it.

Reviews (2) · Last reviewed commit: "Time charging to the battery's own limit..." · Reviewed by Greptile

Comment thread bin/omarchy-battery-status Resolved
Comment thread test/shell.d/battery-status-test.sh Resolved
@dhh
dhh merged commit 535d0ac into quattro Oct 13, 2026
1 check passed
@dhh
dhh deleted the battery-time-from-draw branch October 13, 2026 12:40
omarchybot added a commit to anandude/omarchy that referenced this pull request Oct 14, 2026
Brings the branch onto quattro's battery script and fixtures since omacom#14431 and omacom#15285, so the fix is tested against the code it lands on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants