mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 10:46:16 +01:00
fix battery detection on newer macs (#1170)
This commit is contained in:
@@ -20,9 +20,8 @@ func HasReadableBattery() bool {
|
||||
}
|
||||
haveCheckedBattery = true
|
||||
bat, err := battery.Get(0)
|
||||
if err == nil && bat != nil {
|
||||
systemHasBattery = true
|
||||
} else {
|
||||
systemHasBattery = err == nil && bat != nil && bat.Design != 0 && bat.Full != 0
|
||||
if !systemHasBattery {
|
||||
slog.Debug("No battery found", "err", err)
|
||||
}
|
||||
return systemHasBattery
|
||||
|
||||
Reference in New Issue
Block a user