def on_message(client, userdata, msg) : global shutdown m_decode=str(msg.payload.decode("utf-8","ignore")) if msg.topic=="Vision/"+config["topic"]+"/Cameras/shutdown": shutdown=int(m_decode) else: Save.SetMetadata(json.loads(m_decode),str(msg.topic))