From aba8e214061b6b89ad19e69dcd6982291bb393a1 Mon Sep 17 00:00:00 2001 From: Ollo Date: Thu, 20 Jan 2022 22:06:03 +0100 Subject: [PATCH] Always publish the temperatur --- mqtt.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mqtt.lua b/mqtt.lua index bcb38b5..330488e 100644 --- a/mqtt.lua +++ b/mqtt.lua @@ -6,8 +6,6 @@ tcol=nil -- Mqtt variable local mMqttClient=nil local mMqttConnected = false --- Read Temp -local mOldTemp=nil function handleSingleCommand(client, topic, data) if (data == "ON") then @@ -222,7 +220,6 @@ function startMqttClient() end) lSetupTimer:start() local loldBrightness=0 - mOldTemp=0 local lMqttTimer = tmr.create() local tempCounter=0 -- Check every 12 seconds @@ -253,8 +250,7 @@ function startMqttClient() tempCounter = tempCounter + 1 end collectgarbage() - if (temperatur ~= nil and temperatur ~= mOldTemp) then - mOldTemp = temperatur + if (temperatur ~= nil) then mMqttClient:publish(mqttPrefix .. "/temp", tostring(temperatur/100)..".".. tostring(temperatur%100), 0, 0) else mMqttClient:publish(mqttPrefix .. "/heap", tostring(heapusage), 0, 0)