From 1a1890f65c3c8da774d2327eca6695c99d62f308 Mon Sep 17 00:00:00 2001 From: Robert Borzutzki Date: Wed, 19 Oct 2022 14:53:13 +0200 Subject: [PATCH] j --- examples/mqtt.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/mqtt.py b/examples/mqtt.py index 69ed878..8a9d56d 100644 --- a/examples/mqtt.py +++ b/examples/mqtt.py @@ -44,10 +44,10 @@ 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) + values_image = Image.new('1', (epd.width, epd.height), 255) + values_draw = ImageDraw.Draw(values_image) time.sleep(2) @@ -82,8 +82,9 @@ def on_message(client, userdata, msg): line = 60 print(line) - drawblack.text((150, line), msg.payload.decode(), font = font10, fill = 0) - epd.DisplayPartial(epd.getbuffer(HBlackimage)) + values_draw.rectangle((150, 0, 120, 50), fill = 255) + 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()}`") Connected = False #global variable for the state of the connection