diff --git a/examples/mqtt.py b/examples/mqtt.py index 279b940..8ece4e1 100644 --- a/examples/mqtt.py +++ b/examples/mqtt.py @@ -44,7 +44,11 @@ try: 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.display(epd.getbuffer(HBlackimage)) + + values_image = Image.new('1', (epd.width, epd.height), 255) + values_draw = ImageDraw.Draw(values_image) + time.sleep(2) except IOError as e: @@ -78,9 +82,6 @@ def on_message(client, userdata, msg): line = 60 print(line) - values_image = Image.new('1', (epd.width, epd.height), 255) - values_draw = ImageDraw.Draw(values_image) - values_draw.text((150, line), msg.payload.decode(), font = font10, fill = 0) epd.DisplayPartial(epd.getbuffer(values_image)) #print(f"`{msg.topic}`: `{msg.payload.decode()}`")