Different loop cycles
This commit is contained in:
parent
7e7a87f90a
commit
efe5b38e58
2
main.lua
2
main.lua
@ -186,7 +186,7 @@ function normalOperation()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
-- sync the time every 5 minutes
|
-- sync the time every 5 minutes
|
||||||
tmr.alarm(2, 300000, 1 ,function()
|
tmr.alarm(2, 300003, 1 ,function()
|
||||||
syncTimeFromInternet()
|
syncTimeFromInternet()
|
||||||
displayTime()
|
displayTime()
|
||||||
end)
|
end)
|
||||||
|
3
mqtt.lua
3
mqtt.lua
@ -39,9 +39,10 @@ function startMqttClient()
|
|||||||
startMqtt()
|
startMqtt()
|
||||||
print "Started MQTT client"
|
print "Started MQTT client"
|
||||||
oldBrightness=0
|
oldBrightness=0
|
||||||
tmr.alarm(5, 10000, 1 ,function()
|
tmr.alarm(5, 5001, 1 ,function()
|
||||||
if (oldBrightness ~= briPercent) then
|
if (oldBrightness ~= briPercent) then
|
||||||
m:publish(mqttPrefix .. "/brightness", tostring(briPercent), 0, 0)
|
m:publish(mqttPrefix .. "/brightness", tostring(briPercent), 0, 0)
|
||||||
|
else
|
||||||
m:publish(mqttPrefix .. "/heap", tostring(node.heap()), 0, 0)
|
m:publish(mqttPrefix .. "/heap", tostring(node.heap()), 0, 0)
|
||||||
end
|
end
|
||||||
oldBrightness = briPercent
|
oldBrightness = briPercent
|
||||||
|
Loading…
Reference in New Issue
Block a user