diff options
author | Sean E. Russell <ser@ser1.net> | 2021-01-26 13:15:27 -0600 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2021-01-26 13:15:27 -0600 |
commit | 67831ac97c8a4c45ee08d438214da41372be10df (patch) | |
tree | 4cb0b5d93102aa2a9c789565f6a8034fd95f5cb0 /widgets/batterygauge.go | |
parent | 273f572a871b0511dd0d0860045b308db6e2161b (diff) |
Errors on any battery stopped display of all battery information
Diffstat (limited to 'widgets/batterygauge.go')
-rw-r--r-- | widgets/batterygauge.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/widgets/batterygauge.go b/widgets/batterygauge.go index 20d92d4..3a89590 100644 --- a/widgets/batterygauge.go +++ b/widgets/batterygauge.go @@ -49,7 +49,6 @@ func (b *BatteryGauge) update() { log.Printf("error setting up batteries: %v", err) errLogged = true } - return } if len(bats) < 1 { b.Label = fmt.Sprintf("N/A") @@ -60,6 +59,9 @@ func (b *BatteryGauge) update() { charging := "%d%% ⚡%s" rate := 0.0 for _, bat := range bats { + if bat.Full == 0.0 { + continue + } mx += bat.Full cu += bat.Current if rate < bat.ChargeRate { |