From 96282ea333202093cec1ddfcdf10f4721d74c7b8 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Tue, 3 Oct 2023 17:22:58 +0300 Subject: [PATCH] Bump version to 0.2.2 --- package.json | 2 +- thermostat-analyzer.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 5095884..7aa1f58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vvzvlad/node-red-contrib-rn-combined-nodes", - "version": "0.2.1", + "version": "0.2.2", "description": "", "main": "index.js", "keywords": [ diff --git a/thermostat-analyzer.js b/thermostat-analyzer.js index f77c44c..72ec529 100644 --- a/thermostat-analyzer.js +++ b/thermostat-analyzer.js @@ -121,16 +121,16 @@ module.exports = function(RED) { node.on('input', function(msg) { + if (msg.payload.heater_status === null && typeof msg.payload.heater_status === "undefined") msg_state_text = null + else msg_state_text = { payload: status_reason(msg) } + + if (msg.payload.current_temp === null && typeof msg.payload.current_temp === "undefined") msg_current_temp = null + else msg_state_text = { payload: get_current_temp(msg) } + let key = "fake" - let mqtt_debug = { payload: analyzer(msg), topic: `debug/${node.zone}_${node.room}_/th/${key}`} - let state_text = { payload: status_reason(msg) } - let current_temp = { payload: get_current_temp(msg) } + let msg_mqtt_debug = { payload: analyzer(msg), topic: `debug/${node.zone}_${node.room}_/th/${key}`} - if (heater_status === null || typeof heater_status === "undefined") { - msg_heater_status = null - } - - node.send([mqtt_debug, state_text, current_temp]); + node.send([msg_mqtt_debug, msg_state_text, msg_current_temp]); });