mqtt.disconnect()

mqtt.disconnect()

Disconnects from the MQTT broker; call before the script exits.

Make sure the client is disconnected before the script exits.

Example

mqtt.disconnect();