Skip to content

Commit

Permalink
fix: use short text in dashboard view
Browse files Browse the repository at this point in the history
  • Loading branch information
EuleMitKeule committed Nov 9, 2024
1 parent dfc13fc commit a9c2adf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion inky_phat_dashboard/waste_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async def get_view_datas(self):
elements=[
DashboardElementData(
icon_path=sensor_config.icon_path_small,
text=self._text_from_remaining_days(
text=self._text_from_remaining_days_short(
state_information.remaining_days
)
if state_information.is_available
Expand Down Expand Up @@ -120,6 +120,17 @@ async def get_view_datas(self):

return view_datas

def _text_from_remaining_days_short(self, remaining_days: int) -> str:
"""Get the text from the remaining days."""

if remaining_days == 0:
return "Heute"

if remaining_days == 1:
return "Morgen"

return f"{remaining_days}"

def _text_from_remaining_days(self, remaining_days: int) -> str:
"""Get the text from the remaining days."""

Expand Down

0 comments on commit a9c2adf

Please sign in to comment.