import paho.mqtt.client as mqtt

def on_connect(client,userdata,rc):
  client.subscribe("$dashboard/#")

def on_message(client,userdata,msg):
  pass

client = mqtt.client()
client.on_connect = on_connect
client.on_message = on_message

client.connect('10.132.0.10','dasboard','EnigmA')


def send_msg(msg=None):
  if msg:
    client.reinitialise('dashboard',clean_session=True,userdata=None)
    client.publish('$dashboard/#',msg,qos=0,retain=False)


