Skip to content

Commit

Permalink
Add support for MQTT client ID. #148
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jun 26, 2018
1 parent 8a2e907 commit ecc734c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class MQTT {
options.password = mqttSettings.password;
}

if (mqttSettings.client_id) {
logger.debug(`Using MQTT client ID: '${mqttSettings.client_id}'`);
options.clientId = mqttSettings.client_id;
}

this.client = mqtt.connect(mqttSettings.server, options);

// Register callbacks.
Expand Down

0 comments on commit ecc734c

Please sign in to comment.