[modules/battery-upower] Fix capacity default value

If the capacity isn't set, get() returns None, which is not comparable.

Use -1 instead, which makes the capacity unknown.

fixes #555
This commit is contained in:
Tobias Witek 2020-02-15 11:39:00 +01:00
parent 6da755ab84
commit 57e1b1eb81

View file

@ -240,7 +240,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"]