Different loop cycles

This commit is contained in:
Ollo 2020-12-10 21:11:35 +01:00
parent 7e7a87f90a
commit efe5b38e58
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -39,9 +39,10 @@ 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