mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-21 21:26:16 +01:00
battery: ensure current charge doesn't exceed full capacity (#1668)
This commit is contained in:
@@ -65,7 +65,7 @@ func GetBatteryStats() (batteryPercent uint8, batteryState uint8, err error) {
|
||||
continue
|
||||
}
|
||||
totalCapacity += bat.Full
|
||||
totalCharge += bat.Current
|
||||
totalCharge += min(bat.Current, bat.Full)
|
||||
if bat.State.Raw >= 0 {
|
||||
batteryState = uint8(bat.State.Raw)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user