[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:
parent
6da755ab84
commit
57e1b1eb81
1 changed files with 1 additions and 1 deletions
|
@ -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"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue