From a8e60c2e8726713799c791f4fdead2a48a55f01a Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Wed, 21 Feb 2024 19:46:31 -0500 Subject: [PATCH] Tweak Badger display --- Calendar/BadgerDisplay/calendar.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Calendar/BadgerDisplay/calendar.py b/Calendar/BadgerDisplay/calendar.py index 248b82a..738e2a5 100644 --- a/Calendar/BadgerDisplay/calendar.py +++ b/Calendar/BadgerDisplay/calendar.py @@ -70,10 +70,16 @@ def update_display(): badger.set_font("bitmap8") text = f"{name}" - text_width = badger.measure_text(text, scale=2) - badger.text(text, math.floor((WIDTH - text_width) / 2), 25, scale=2) + text_width = badger.measure_text(text, scale=3) + badger.text(text, math.floor((WIDTH - text_width) / 2), 25, scale=3) + + if is_today: + text = "Today" + elif days_until == 0: + text = "Tomorrow" + else: + text = f"{days_until} days after today" - text = "Today" if is_today else f"{days_until} days {hours_until} hours" text_width = badger.measure_text(text, scale=2) badger.text(text, math.floor((WIDTH - text_width) / 2), 65, scale=2)