Skip to content

Commit 55b5ec6

Browse files
committed
mqtt-all: fix display box
The previous display box function wasn't propoerly used This fix the information displayed on the enviro+ display Signed-off-by: Alexandre Esse <[email protected]>
1 parent a102a25 commit 55b5ec6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/mqtt-all.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def display_status(disp, mqtt_broker):
136136
message = f"{device_serial_number}\nWi-Fi: {wifi_status}\nmqtt-broker: {mqtt_broker}"
137137
img = Image.new("RGB", (WIDTH, HEIGHT), color=(0, 0, 0))
138138
draw = ImageDraw.Draw(img)
139-
x1, y1, x2, y2 = font.getbbox(message)
139+
x1, y1, x2, y2 = draw.textbbox((0,0), message, font=font)
140140
size_x = x2 - x1
141141
size_y = y2 - y1
142142
x = (WIDTH - size_x) / 2

0 commit comments

Comments
 (0)