Skip to content

Commit

Permalink
Fix "undefined" in mqt topic name
Browse files Browse the repository at this point in the history
  • Loading branch information
greengiant committed Jan 20, 2020
1 parent 5fd9675 commit 5ae7e27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
} }
Expand Down Expand Up @@ -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
})
Expand All @@ -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('/')
}

/**
Expand Down

0 comments on commit 5ae7e27

Please sign in to comment.