Only update in main loop

This commit is contained in:
Ollo 2021-03-23 21:48:57 +01:00
parent 667350781c
commit 92a1c2c8d2

View File

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