From 51decbad0c5ab00fb47101fd54198c53c017db9e Mon Sep 17 00:00:00 2001 From: Sajjad Date: Fri, 25 Oct 2024 04:18:21 -0400 Subject: [PATCH] fix issue when capacity equal to n/a --- bumblebee_status/modules/contrib/battery.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bumblebee_status/modules/contrib/battery.py b/bumblebee_status/modules/contrib/battery.py index 7c656426..daaa89bb 100644 --- a/bumblebee_status/modules/contrib/battery.py +++ b/bumblebee_status/modules/contrib/battery.py @@ -58,6 +58,8 @@ def capacity(self, battery): capacity = self.read(battery, "capacity", 100) if capacity != "n/a": capacity = int(capacity) + else: + capacity = 0 return capacity if capacity < 100 else 100