add color for house energy usage

This commit is contained in:
Robert Borzutzki 2022-10-19 21:29:50 +02:00
parent e6fdb70fd1
commit 5725cb3123

View File

@ -109,7 +109,10 @@ try:
drawblack = ImageDraw.Draw(HBlackimage) drawblack = ImageDraw.Draw(HBlackimage)
drawred = ImageDraw.Draw(HRedimage) drawred = ImageDraw.Draw(HRedimage)
drawblack.text((5, 0), 'PV Produktion', font = font10, fill = 0) drawblack.text((5, 0), 'PV Produktion', font = font10, fill = 0)
drawblack.text((5, 15), 'Hausverbrauch', font = font10, fill = 0) if value_pvProduction < value_wHouseConsumption:
drawred.text((5, 15), 'Hausverbrauch', font = font10, fill = 0)
else:
drawblack.text((5, 15), 'Hausverbrauch', font = font10, fill = 0)
if value_energyImportExport > 0: if value_energyImportExport > 0:
drawred.text((5, 30), 'Strom Import', font = font10, fill = 0) drawred.text((5, 30), 'Strom Import', font = font10, fill = 0)
else: else:
@ -130,7 +133,10 @@ try:
#drawblack.rectangle((150, 0, 220, 50), fill = 255) #drawblack.rectangle((150, 0, 220, 50), fill = 255)
drawblack.text((150, 0), str(value_pvProduction) + " W", font = font10, fill = 0) drawblack.text((150, 0), str(value_pvProduction) + " W", font = font10, fill = 0)
#drawblack.rectangle((150, 15, 220, 50), fill = 255) #drawblack.rectangle((150, 15, 220, 50), fill = 255)
drawblack.text((150, 15), str(value_wHouseConsumption) + " W", font = font10, fill = 0) if value_pvProduction < value_wHouseConsumption:
drawred.text((150, 15), str(value_wHouseConsumption) + " W", font = font10, fill = 0)
else:
drawblack.text((150, 15), str(value_wHouseConsumption) + " W", font = font10, fill = 0)
#drawblack.rectangle((150, 30, 220, 50), fill = 255) #drawblack.rectangle((150, 30, 220, 50), fill = 255)
if value_energyImportExport > 0: if value_energyImportExport > 0:
drawred.text((150, 30), str(value_energyImportExport) + " W", font = font10, fill = 0) drawred.text((150, 30), str(value_energyImportExport) + " W", font = font10, fill = 0)