Addition color format supported
This commit is contained in:
parent
8789f75e27
commit
62f40d202c
1
main.lua
1
main.lua
@ -175,6 +175,7 @@ function normalOperation()
|
|||||||
if (startTelnetServer ~= nil) then
|
if (startTelnetServer ~= nil) then
|
||||||
startTelnetServer()
|
startTelnetServer()
|
||||||
else
|
else
|
||||||
|
displayTime()
|
||||||
print("NO Telent found")
|
print("NO Telent found")
|
||||||
end
|
end
|
||||||
setupCounter=setupCounter-1
|
setupCounter=setupCounter-1
|
||||||
|
2
mqtt.lua
2
mqtt.lua
@ -9,7 +9,7 @@ function handleSingleCommand(client, topic, data)
|
|||||||
elseif (data == "OFF") then
|
elseif (data == "OFF") then
|
||||||
briPercent=0
|
briPercent=0
|
||||||
m:publish(mqttPrefix .. "/clock", "OFF", 0, 0)
|
m:publish(mqttPrefix .. "/clock", "OFF", 0, 0)
|
||||||
elseif (data:sub(1,1) == "#" and data:len() == 7) then
|
elseif ((data:sub(1,1) == "#" and data:len() == 7) or (string.match(data, "%d+,%d+,%d+"))) then
|
||||||
red = tonumber(data:sub(2,3), 16)
|
red = tonumber(data:sub(2,3), 16)
|
||||||
green = tonumber(data:sub(4,5), 16)
|
green = tonumber(data:sub(4,5), 16)
|
||||||
blue = tonumber(data:sub(6,7), 16)
|
blue = tonumber(data:sub(6,7), 16)
|
||||||
|
Loading…
Reference in New Issue
Block a user