Clamp Linux battery capacity percentage (#1957)

This commit is contained in:
Vito Cappello
2026-08-14 10:17:38 -04:00
committed by GitHub
parent 6607d4c0d6
commit cf90249519
2 changed files with 11 additions and 0 deletions

View File

@@ -102,6 +102,7 @@ func GetBatteryStats() (batteryPercent uint8, batteryState uint8, err error) {
if parseErr != nil {
continue
}
cap = min(max(cap, 0), 100)
totalPercent += cap
count++