mqtt topic update

This commit is contained in:
smash 2018-12-11 12:50:59 +01:00
parent 43dd0af3ec
commit aef0244e63

View file

@ -85,7 +85,7 @@ def spaceapi():
def on_message(client, userdata, msg): def on_message(client, userdata, msg):
# print(msg.topic+" "+str(msg.payload)) # print(msg.topic+" "+str(msg.payload))
print("Received message '" + str(msg.payload) + "' on topic '" + msg.topic + "' with QoS " + str(msg.qos)) print("Received message '" + str(msg.payload) + "' on topic '" + msg.topic + "' with QoS " + str(msg.qos))
if msg.topic == '/UHB/public/status': if msg.topic == '/UHB/status/public':
if msg.payload == "0": if msg.payload == "0":
# space_obj["state"] = {u'open': True,u'lastchange': time.time()} # space_obj["state"] = {u'open': True,u'lastchange': time.time()}
space_obj["state"]["open"] = True space_obj["state"]["open"] = True