From 73f8d7d14769ebaf421746bf182c16f55c466fa7 Mon Sep 17 00:00:00 2001 From: Mika Koivisto Date: Thu, 13 Jun 2024 13:27:48 +0300 Subject: [PATCH] Fix bug --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index faf5284..9de5527 100644 --- a/app.js +++ b/app.js @@ -316,7 +316,7 @@ class App { let id = `xiomi_${mac}_${disco.jsonAttribute}`; let objectId = `${objectIdPrefix}${mac}_${disco.jsonAttribute}`; let confTopic = `${config.homeassistantTopicPrefix}/sensor/${objectId}/config`; - let stateTopic = (disco.stateTopicPostfix && disco.stateTopicPostfix !== '') ? `${config.xiomiTopic}/${mac}/${stateTopicPostfix}` : `${config.xiomiTopic}/${mac}`; + let stateTopic = (disco.stateTopicPostfix && disco.stateTopicPostfix !== '') ? `${config.xiomiTopic}/${mac}/${disco.stateTopicPostfix}` : `${config.xiomiTopic}/${mac}`; let deviceName = (measurement.name && measurement.name !== '') ? `${measurement.name}` : `Xiomi sensor ${mac.slice(-6)}`; let name = (measurement.name && measurement.name !== '') ? `${measurement.name} ${disco.namePostfix}` : `${disco.namePostfix}`; let valueTemplate = `{{ value_json.${disco.jsonAttribute}${disco.jsonAttributeMutator} | float | round(${disco.precision}) }}`;