Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8051

Beginners • Re: MQTT publish fomatted sensor reading

$
0
0
client.publish("sensor1",temperature_formatted()) omit the braces after temperature_formatted

And, perhaps, omit the braces in
temperature_formatted = ( f"{temperature:.1f}" )

Side topic, I would add a client.loop_start() after the connect.

Statistics: Posted by ghp — Sat Apr 19, 2025 4:49 pm



Viewing all articles
Browse latest Browse all 8051

Trending Articles