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]