Fix "no batt" case, when one of the batteries have dodgy driver

This commit is contained in:
eleksir
2025-04-07 19:52:41 +03:00
parent 40eaac419d
commit f905ba79a3
3 changed files with 144 additions and 140 deletions

View File

@@ -11,13 +11,12 @@ import (
// Program entry point.
func main() {
for {
batteries, err := battery.GetAll()
batteries, _ := battery.GetAll()
if err != nil {
fmt.Printf("Unable to get battery info: %w", err)
for index, battery := range batteries {
fmt.Printf("Battery %s: %s\n", index, spew.Sdump(battery))
}
spew.Dump(batteries)
time.Sleep(1 * time.Second)
}
}