From 57e1b1eb81b159d137e3ae75276490d81da67570 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 15 Feb 2020 11:39:00 +0100 Subject: [PATCH] [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 --- bumblebee/modules/battery-upower.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumblebee/modules/battery-upower.py b/bumblebee/modules/battery-upower.py index 24efecf..f3d59ba 100644 --- a/bumblebee/modules/battery-upower.py +++ b/bumblebee/modules/battery-upower.py @@ -240,7 +240,7 @@ class Module(bumblebee.engine.Module): def state(self, widget): state = [] - capacity = widget.get("capacity") + capacity = widget.get("capacity", -1) if capacity < 0: return ["critical", "unknown"]