diff --git a/wideboy/scenes/default/tile_grid.py b/wideboy/scenes/default/tile_grid.py index a199875..134e740 100644 --- a/wideboy/scenes/default/tile_grid.py +++ b/wideboy/scenes/default/tile_grid.py @@ -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 @@ -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 @@ -190,7 +190,7 @@ def open(self): @property def label(self): - return format_duration(self.value) + return format_minutes(self.value) # Network Tiles