def mqtt_on_disconnect(self, client, userdata, rc):
    if (rc == 0):
        LOG.warning('Unexpected MQTT disconnection.')
    else:
        LOG.warning('Unexpected MQTT disconnection. Will auto-reconnect')
def mqtt_on_disconnect(self, client, userdata, rc):
    if (rc == 0):
        LOG.warning('Unexpected MQTT disconnection.')
    else:
        LOG.warning('Unexpected MQTT disconnection. Will auto-reconnect')