|
|
|
@ -94,7 +94,7 @@ exports.mqttAsync = function (hostname, topic, okMessage, options = {}) {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
const { port, username, password, interval = 20 } = options;
|
|
|
|
|
try {
|
|
|
|
|
// Adds mqtt protocol to the hostname if not already present
|
|
|
|
|
// Adds MQTT protocol to the hostname if not already present
|
|
|
|
|
if (!/^(?:http|mqtt)s?:\/\//.test(hostname)) {
|
|
|
|
|
hostname = "mqtt://" + hostname;
|
|
|
|
|
}
|
|
|
|
|