From 42fcbc34d23384594f8d6cf664e34495167c2bee Mon Sep 17 00:00:00 2001 From: Borzutzki Robert Date: Mon, 25 Nov 2024 22:37:54 +0100 Subject: [PATCH] add ruhestand --- examples/date-diff.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/date-diff.py b/examples/date-diff.py index fae5e3d..241be85 100644 --- a/examples/date-diff.py +++ b/examples/date-diff.py @@ -43,7 +43,7 @@ from datetime import datetime, timedelta, date start_time = date.today() print(start_time.strftime("%d.%m.%Y")) -end_time = date(2025, 6, 10) +ruhestand = date(2025, 6, 10) # Zeitdelta berechnen duration = end_time - start_time print(duration) # Ausgabe: 9 Tage, 2:30:00 @@ -63,12 +63,12 @@ def init_monitor(): # Drawing on the Horizontal image logging.info("1.Drawing on the Horizontal image...") - drawblack.text((4, 0), 'Noch: ' + str(duration) + 'bis', font = font16, fill = 0) - drawblack.text((4, 16), 'Hausverbrauch', font = font16, fill = 0) - drawblack.text((4, 32), 'Strom Import', font = font16, fill = 0) - drawblack.text((4, 48), 'Batterie', font = font16, fill = 0) - drawblack.text((4, 64), 'Batterie Entladen', font = font16, fill = 0) - drawblack.text((4, 80), 'Auto Laden', font = font16, fill = 0) + drawblack.text((4, 0), 'Noch: ' + str(duration.days), font = font16, fill = 0) + drawblack.text((4, 16), 'Oder: ' + str(duration.seconds), font = font16, fill = 0) + drawblack.text((4, 32), ' ', font = font16, fill = 0) + drawblack.text((4, 48), ' ', font = font16, fill = 0) + drawblack.text((4, 64), ' ', font = font16, fill = 0) + drawblack.text((4, 80), str(ruhestand.strftime("%A %B %d.%m.%Y")), font = font16, fill = 0) epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))