# -*- coding: utf-8 -*-
# cython: language_level=3
import paho.mqtt.client as mqtt


cliet_udid = '3d53149e-408f-56c6-99ef-29fae67f8efc'
topic = "/maintain/room/master/" + cliet_udid + "/"
def on_connect(client, userdata, flags, rc):
    print("Connected with result code "+str(rc))
    client.subscribe(topic)

def on_message(client, userdata, msg):
    print(f"Received message '{msg.payload.decode()}' on topic '{msg.topic}'")

mqtt_client = mqtt.Client()
mqtt_client.on_connect = on_connect
mqtt_client.on_message = on_message

mqtt_client.connect("192.168.5.215", 1883, 60)

mqtt_client.loop_forever()

