Different loop cycles
This commit is contained in:
5
mqtt.lua
5
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
|
||||
end
|
||||
|
Reference in New Issue
Block a user