Skip to content

Commit

Permalink
Merge pull request #1026 from SajjadSabzkar/main
Browse files Browse the repository at this point in the history
fix issue when capacity equal to n/a
  • Loading branch information
tobi-wan-kenobi authored Oct 25, 2024
2 parents becd773 + 51decba commit 72cd629
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 72cd629

Please sign in to comment.