From 1ca19a792db9be25667eeabb2ea3e07963e66beb Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 9 Apr 2018 17:47:26 +0200 Subject: [PATCH] Use base_topic from configuration.yaml. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index af9a0ef5..a358a2e7 100644 --- a/index.js +++ b/index.js @@ -116,7 +116,7 @@ function handleMessage(msg) { // Parse the message. const friendlyName = settings.devices[device.ieeeAddr].friendly_name; const payload = parser.parse(msg).toString(); - const topic = `xiaomi/${friendlyName}/${parser.topic}`; + const topic = `${settings.mqtt.base_topic}/${friendlyName}/${parser.topic}`; // Send the message. console.log(`MQTT publish, topic: '${topic}', payload: '${payload}'`);