From 001c75916f80e6b4e783e0d2cf41546aab3e5642 Mon Sep 17 00:00:00 2001 From: jerick Date: Mon, 28 Nov 2022 14:58:19 -0500 Subject: [PATCH] Changed brackets to not be substituted --- mqtt/tempSensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mqtt/tempSensor.py b/mqtt/tempSensor.py index 4381eda..3ede709 100644 --- a/mqtt/tempSensor.py +++ b/mqtt/tempSensor.py @@ -53,7 +53,7 @@ while True: client.connect(broker, port) #Publish Temp Results - tempMsg = '{ "temperature": {} }'.format(temp) + tempMsg = '{{ "temperature": {} }}'.format(temp) result = client.publish(tempTopic, tempMsg) # result: [0, 1] status = result[0] @@ -63,7 +63,7 @@ while True: print(f"Failed to send message to topic {tempTopic}") #Publish Humid Results - humidMsg = '{ "humidity": {} }'.format(humidity) + humidMsg = '{{ "humidity": {} }}'.format(humidity) result = client.publish(humidTopic, humidMsg) # result: [0, 1] status = result[0]