Repository navigation
Conversation
Some ACPI batteries list power_now and current_now with read permission but fail every read with ENODEV. The empty read became 0W and replaced UPower's correct energy-rate. Go by what the read returns instead. Fixes omacom#15373 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The battery-status test conflicted with the Omarchy language case quattro added at the same spot. Both are kept, the language case first: the unreadable-sysfs case turns power_now into a directory and raises UPower's rate in the shared fixture, which would change the time to full the language case expects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; no blocking issues were found. Summary
Reviews (2) · Last reviewed commit: "Merge quattro into fix-battery-unreadabl..." · Reviewed by Greptile |
|
Reviewed and verified on a worker built from the Omarchy ISO. The fix holds, and nothing in it needs changing. Merge with quattro. The branch conflicted with quattro in What was checked:
Second opinion: Codex Medium reviewed this head and found no correctness defect. Its reasoning was not guaranteed to be independent of mine. It made two optional points, which I left alone. The script reads Related: #15389 and #15541 fix the same issue a different way. This PR is the oldest of the three and covers the same cases, including the current × voltage fallback when This is waiting on the maintainer. |
omacom#16272 added full and sparse status-line cases at the same spot in battery-status-test.sh. The unreadable-attribute case runs first and then removes the directories it put in place of power_now and current_now, since the cases after it write power_now as a file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The branch conflicted with quattro again, so I merged quattro into it a second time. I pushed 0238bba. Nothing in your fix changed. The merge. #16272 added a full-battery case and a sparse-reading case to What was checked, on a worker built from the Omarchy ISO, at 0238bba:
Second opinion: Codex Medium and muse-spark-1.3-contributor (High) reviewed this head, including the merge resolution, and found no defect. They agreed with my reading, but their independence from it isn't guaranteed. Both noted that the test doesn't check stderr stays quiet. Codex also noted that Related: #15389 and #15541 fix the same issue, #15373, a different way. Both models were asked separately which to carry forward, and both picked this one: it is the oldest, and it covers the same cases. #15541's extra tests (current × voltage, an unreadable This is waiting on the maintainer. |
|
The reported failure is now covered on On a fresh ISO worker, I checked this head (0238bba), its old merge base, and current The recorded translation CI failure has no retained jobs or logs, so its original cause is unknown. On the worker, the structural translation test fails with the same locale-generation permission error on this head and its old base; current Codex High reviewed this with Opus 5.5 High and muse-wonder via pi, thinking high. Both agreed that no behavior or additional test needs porting; their independence from my review is not guaranteed. Nothing was pushed. This remains open for the maintainer to close as superseded by #17265. |
Fixes #15373
On some ACPI batteries (seen on an HP Spectre x360 13-aw0xxx),
power_nowandcurrent_nowexist and pass[[ -r ]], but every read fails with ENODEV.omarchy-battery-statusgated only on-r, so the empty read reached awk as0and replaced UPower's correctenergy-rate. The widget then showed 0W while charging.Change
power_now,current_nowandvoltage_nowup front with errors suppressed. Use the sysfs rate only when the read actually returns a value, and otherwise keep UPower'senergy-rate.Testing
test/shell.d/battery-status-test.sh. It uses directories in place ofpower_now/current_now, since a directory passes-rbut can't be read, like the ENODEV attribute. It fails before this change and passes after it, along with the existing cases.