mqtt cleanup
This commit is contained in:
parent
0857eb0e3c
commit
84f5611a67
2
mqtt.lua
2
mqtt.lua
@ -3,7 +3,6 @@ m=nil
|
|||||||
mqttConnected = false
|
mqttConnected = false
|
||||||
-- Temp:
|
-- Temp:
|
||||||
t=nil
|
t=nil
|
||||||
rowbgColor= {}
|
|
||||||
|
|
||||||
function handleSingleCommand(client, topic, data)
|
function handleSingleCommand(client, topic, data)
|
||||||
if (data == "ON") then
|
if (data == "ON") then
|
||||||
@ -158,6 +157,7 @@ function startMqttClient()
|
|||||||
local temp = nil
|
local temp = nil
|
||||||
if (t ~= nil) then
|
if (t ~= nil) then
|
||||||
temp=readTemp()
|
temp=readTemp()
|
||||||
|
print(tostring(temp) .. "°C")
|
||||||
end
|
end
|
||||||
if (oldBrightness ~= briPercent) then
|
if (oldBrightness ~= briPercent) then
|
||||||
m:publish(mqttPrefix .. "/brightness", tostring(briPercent), 0, 0)
|
m:publish(mqttPrefix .. "/brightness", tostring(briPercent), 0, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user