[modules/battery_all] Set default capacity

If capacity cannot be read -> set it to -1

fixes #572
This commit is contained in:
Tobias Witek 2020-03-11 21:24:27 +01:00
parent bb2c92732e
commit 929f4751c3

View file

@ -88,7 +88,7 @@ class Module(bumblebee.engine.Module):
def state(self, widget): def state(self, widget):
state = [] state = []
capacity = widget.get("capacity") capacity = widget.get("capacity", -1)
if capacity < 0: if capacity < 0:
return ["critical", "unknown"] return ["critical", "unknown"]