Skip to content

Commit 2bf11f2

Browse files
authored
Merge pull request #144 from ahresse/fix-mqtt-display
Fix mqtt display
2 parents c4b6d45 + f32e560 commit 2bf11f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/mqtt-all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ def display_status(disp, mqtt_broker):
133133
text_colour = (255, 255, 255)
134134
back_colour = (0, 170, 170) if check_wifi() else (85, 15, 15)
135135
device_serial_number = get_serial_number()
136-
message = f"{device_serial_number}\nWi-Fi: {wifi_status}\nmqtt-broker: {mqtt_broker}"
136+
message = f"Serial: {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)