Only update in main loop
This commit is contained in:
parent
667350781c
commit
92a1c2c8d2
3
mqtt.lua
3
mqtt.lua
@ -25,9 +25,6 @@ function handleSingleCommand(client, topic, data)
|
|||||||
colorBg=string.char(green * briPer / 100, red * briPer / 100, blue * briPer / 100)
|
colorBg=string.char(green * briPer / 100, red * briPer / 100, blue * briPer / 100)
|
||||||
print("Updated BG: " .. tostring(red) .. "," .. tostring(green) .. "," .. tostring(blue) )
|
print("Updated BG: " .. tostring(red) .. "," .. tostring(green) .. "," .. tostring(blue) )
|
||||||
m:publish(mqttPrefix .. "/background", tostring(red) .. "," .. tostring(green) .. "," .. tostring(blue), 0, 0)
|
m:publish(mqttPrefix .. "/background", tostring(red) .. "," .. tostring(green) .. "," .. tostring(blue), 0, 0)
|
||||||
if (displayTime~= nil) then
|
|
||||||
displayTime()
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if (tonumber(data) >= 0 and tonumber(data) <= 100) then
|
if (tonumber(data) >= 0 and tonumber(data) <= 100) then
|
||||||
briPer=tonumber(data)
|
briPer=tonumber(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user