Skip to content

Commit

Permalink
refactor: Add leading 0 to the minutes of the time info
Browse files Browse the repository at this point in the history
  • Loading branch information
harrtho committed Jan 10, 2023
1 parent a9e8ef3 commit 656fa79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def show_info(self, battery_info):
external = battery_info['ExternalConnected']

if time_to_empty < 15000:
time_left = f'{round(time_to_empty/60)}:{round(time_to_empty%60)}'
time_left = f'{round(time_to_empty/60)}:{round(time_to_empty%60):02d}'

if time_to_full < 15000:
time_full = f'{round(time_to_full/60)}:{round(time_to_full%60)}'
time_full = f'{round(time_to_full/60)}:{round(time_to_full%60):02d}'

if charging:
time_info = f'{time_full} until full'
Expand Down

0 comments on commit 656fa79

Please sign in to comment.