mirror of
https://github.com/henrygd/beszel.git
synced 2026-08-19 08:47:46 +02:00
Clamp Linux battery capacity percentage (#1957)
This commit is contained in:
@@ -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++
|
||||
|
||||
|
||||
Reference in New Issue
Block a user