From 929f4751c3ba8b6d57c682e8f2c07f7232919ae6 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Wed, 11 Mar 2020 21:24:27 +0100 Subject: [PATCH] [modules/battery_all] Set default capacity If capacity cannot be read -> set it to -1 fixes #572 --- bumblebee/modules/battery_all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumblebee/modules/battery_all.py b/bumblebee/modules/battery_all.py index 2fe965c..8e1b8f7 100644 --- a/bumblebee/modules/battery_all.py +++ b/bumblebee/modules/battery_all.py @@ -88,7 +88,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"]