From 636a76a4e7705daa7fc23a7872a5c6d5098f3075 Mon Sep 17 00:00:00 2001 From: Robert Borzutzki Date: Wed, 19 Oct 2022 15:16:32 +0200 Subject: [PATCH] add label --- examples/mqtt.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/mqtt.py b/examples/mqtt.py index 0c1bc4d..b773050 100644 --- a/examples/mqtt.py +++ b/examples/mqtt.py @@ -38,13 +38,13 @@ try: #HRedimage = Image.new('1', (epd.height, epd.width), 255) # 298*126 ryimage: red or yellow image drawblack = ImageDraw.Draw(HBlackimage) #drawred = ImageDraw.Draw(HRedimage) - #drawblack.text((5, 0), 'PV Produktion', font = font10, fill = 0) - #drawblack.text((5, 15), 'Hausverbrauch', font = font10, fill = 0) - #drawblack.text((5, 30), 'Strom Import/Export', font = font10, fill = 0) - #drawblack.text((5, 45), 'Batterie %', font = font10, fill = 0) - #drawblack.text((5, 60), 'Batterie Laden/Entladen', font = font10, fill = 0) + drawblack.text((5, 0), 'PV Produktion', font = font10, fill = 0) + drawblack.text((5, 15), 'Hausverbrauch', font = font10, fill = 0) + drawblack.text((5, 30), 'Strom Import/Export', font = font10, fill = 0) + drawblack.text((5, 45), 'Batterie %', font = font10, fill = 0) + drawblack.text((5, 60), 'Batterie Laden/Entladen', font = font10, fill = 0) #epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRedimage)) - #epd.DisplayPartial(epd.getbuffer(HBlackimage)) + epd.DisplayPartial(epd.getbuffer(HBlackimage)) values_image = Image.new('1', (epd.height, epd.width), 255) values_draw = ImageDraw.Draw(values_image) @@ -82,7 +82,7 @@ def on_message(client, userdata, msg): line = 60 print(line) - values_draw.rectangle((150, line, 220, 50), fill = 255) + values_draw.rectangle((150, line, 220, 50), fill = 0) values_draw.text((150, line), msg.payload.decode(), font = font10, fill = 0) epd.DisplayPartial(epd.getbuffer(values_image)) time.sleep(1)