Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglemansweep committed Nov 22, 2023
1 parent 58f7780 commit 69d297a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wideboy/scenes/default/tile_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class GridCell(VerticalCollapseTileGridCell):
def format_watts(watts: int):
return "{:.0f}W".format(watts) if watts < 1000 else "{:.1f}kW".format(watts / 1000)

def format_duration(seconds: int):
hours = seconds // 3600
minutes = seconds % 3600 // 60
def format_minutes(minutes: int):
hours = minutes // 60
minutes = minutes % 60
return f"{hours}:{minutes:02d}"

# TILE DEFINITIONS
Expand Down Expand Up @@ -174,7 +174,7 @@ def open(self):

@property
def label(self):
return format_duration(self.value)
return format_minutes(self.value)

class CellBatteryDischargeRemainingTime(GridCell):
icon_codepoint = FontAwesomeIcons.ICON_FA_PLUG_CIRCLE_MINUS
Expand All @@ -190,7 +190,7 @@ def open(self):

@property
def label(self):
return format_duration(self.value)
return format_minutes(self.value)

# Network Tiles

Expand Down

0 comments on commit 69d297a

Please sign in to comment.