Changed brackets to not be substituted

This commit is contained in:
2022-11-28 14:58:19 -05:00
parent 8cc13e8da0
commit 001c75916f

View File

@@ -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]