From efe5b38e587b95a7f7fa168f1f4a9ac0a0f8fe90 Mon Sep 17 00:00:00 2001 From: Ollo Date: Thu, 10 Dec 2020 21:11:35 +0100 Subject: [PATCH] Different loop cycles --- main.lua | 2 +- mqtt.lua | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main.lua b/main.lua index a7c96ba..bc1de9a 100644 --- a/main.lua +++ b/main.lua @@ -186,7 +186,7 @@ function normalOperation() end) -- sync the time every 5 minutes - tmr.alarm(2, 300000, 1 ,function() + tmr.alarm(2, 300003, 1 ,function() syncTimeFromInternet() displayTime() end) diff --git a/mqtt.lua b/mqtt.lua index 23c3ec1..14e9bb9 100644 --- a/mqtt.lua +++ b/mqtt.lua @@ -39,12 +39,13 @@ function startMqttClient() startMqtt() print "Started MQTT client" oldBrightness=0 - tmr.alarm(5, 10000, 1 ,function() + tmr.alarm(5, 5001, 1 ,function() if (oldBrightness ~= briPercent) then m:publish(mqttPrefix .. "/brightness", tostring(briPercent), 0, 0) + else m:publish(mqttPrefix .. "/heap", tostring(node.heap()), 0, 0) end oldBrightness = briPercent end) end -end \ No newline at end of file +end