add ruhestand

This commit is contained in:
Borzutzki Robert 2024-11-25 22:37:54 +01:00
parent d5d72f3fda
commit 42fcbc34d2

View File

@ -43,7 +43,7 @@ from datetime import datetime, timedelta, date
start_time = date.today() start_time = date.today()
print(start_time.strftime("%d.%m.%Y")) print(start_time.strftime("%d.%m.%Y"))
end_time = date(2025, 6, 10) ruhestand = date(2025, 6, 10)
# Zeitdelta berechnen # Zeitdelta berechnen
duration = end_time - start_time duration = end_time - start_time
print(duration) # Ausgabe: 9 Tage, 2:30:00 print(duration) # Ausgabe: 9 Tage, 2:30:00
@ -63,12 +63,12 @@ def init_monitor():
# Drawing on the Horizontal image # Drawing on the Horizontal image
logging.info("1.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, 0), 'Noch: ' + str(duration.days), font = font16, fill = 0)
drawblack.text((4, 16), 'Hausverbrauch', font = font16, fill = 0) drawblack.text((4, 16), 'Oder: ' + str(duration.seconds), font = font16, fill = 0)
drawblack.text((4, 32), 'Strom Import', font = font16, fill = 0) drawblack.text((4, 32), ' ', font = font16, fill = 0)
drawblack.text((4, 48), 'Batterie', font = font16, fill = 0) drawblack.text((4, 48), ' ', font = font16, fill = 0)
drawblack.text((4, 64), 'Batterie Entladen', font = font16, fill = 0) drawblack.text((4, 64), ' ', font = font16, fill = 0)
drawblack.text((4, 80), 'Auto Laden', 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)) epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))