Skip to content

Commit 52fe645

Browse files
authored
fix: "undefined" in mqt topic name (#30)
Fix "undefined" in mqt topic name
2 parents 5fd9675 + 5ae7e27 commit 52fe645

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/server.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function start () {
1818
log.info(pkg.name + ' ' + pkg.version + ' starting')
1919

2020
const mqttOptions = { will: {
21-
topic: config.name + '/connected',
21+
topic: config.instance + '/connected',
2222
message: 0,
2323
qos: 0
2424
} }
@@ -110,7 +110,7 @@ function publishConnectionStatus (status) {
110110
}
111111
currentStatus = status
112112
// 1 for mqtt online two for connected to hardware (should this be 2 after first image?)
113-
client.publish(config.name + '/connected', status, {
113+
client.publish(config.instance + '/connected', status, {
114114
qos: 0,
115115
retain: true
116116
})
@@ -124,7 +124,7 @@ function publishConnectionStatus (status) {
124124
* @return {String} MQTT Topic name
125125
*/
126126
function getTopicFor (device, type) {
127-
return [config.name, device, type].join('/')
127+
return [config.instance, device, type].join('/')
128128
}
129129

130130
/**

0 commit comments

Comments
 (0)