Skip to content

Commit

Permalink
fix: "undefined" in mqt topic name (#30)
Browse files Browse the repository at this point in the history
Fix "undefined" in mqt topic name
  • Loading branch information
svrooij authored Jan 20, 2020
2 parents 5fd9675 + 5ae7e27 commit 52fe645
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 52fe645

Please sign in to comment.