Skip to content

Commit

Permalink
fix issue when capacity equal to n/a
Browse files Browse the repository at this point in the history
  • Loading branch information
sajjadsabzkar committed Oct 25, 2024
1 parent becd773 commit 51decba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bumblebee_status/modules/contrib/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 51decba

Please sign in to comment.