Skip to content

Commit

Permalink
fix: divided by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladbaby committed Mar 14, 2024
1 parent 5f1d614 commit 6247bf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/components/battery_history_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def updateBatteryHistory(self, battery_history_dic):
stride = 15
previous_timestamp = 0
i = 0
linewidth = min(5, self.width() / (len(x_list)) * 3)
linewidth = min(5, self.width() / (len(x_list)) * 3 if len(x_list) != 0 else 1)
for x, y, charging in zip(x_list, battery_history_dic["battery"], battery_history_dic["charging"]):
# vertical lines with color indicating charging status
# if consecutive records less than `stride`, then ignore
Expand Down

0 comments on commit 6247bf7

Please sign in to comment.