From 5ae7e27f9af59cd903528a16a575c00139043e9b Mon Sep 17 00:00:00 2001 From: Ryan Bonham Date: Sun, 19 Jan 2020 20:00:49 -0500 Subject: [PATCH] Fix "undefined" in mqt topic name --- src/server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server.js b/src/server.js index 6bdb6bc..49c9c34 100644 --- a/src/server.js +++ b/src/server.js @@ -18,7 +18,7 @@ function start () { log.info(pkg.name + ' ' + pkg.version + ' starting') const mqttOptions = { will: { - topic: config.name + '/connected', + topic: config.instance + '/connected', message: 0, qos: 0 } } @@ -110,7 +110,7 @@ function publishConnectionStatus (status) { } currentStatus = status // 1 for mqtt online two for connected to hardware (should this be 2 after first image?) - client.publish(config.name + '/connected', status, { + client.publish(config.instance + '/connected', status, { qos: 0, retain: true }) @@ -124,7 +124,7 @@ function publishConnectionStatus (status) { * @return {String} MQTT Topic name */ function getTopicFor (device, type) { - return [config.name, device, type].join('/') + return [config.instance, device, type].join('/') } /**