diff --git a/examples/mqtt.py b/examples/mqtt.py index 11d6abe..ed7af66 100644 --- a/examples/mqtt.py +++ b/examples/mqtt.py @@ -78,10 +78,13 @@ def on_message(client, userdata, msg): line = 60 print(line) - drawblack.text((150, line), " ", font = font10, fill = 0) - epd.DisplayPartial(epd.getbuffer(HBlackimage)) - drawblack.text((150, line), msg.payload.decode(), font = font10, fill = 0) - epd.DisplayPartial(epd.getbuffer(HBlackimage)) + epd.init() + epd.Clear() + 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()}`") Connected = False #global variable for the state of the connection