Changed brackets to not be substituted
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user