Addition color format supported

This commit is contained in:
Ollo 2021-01-15 18:14:39 +01:00
parent 8789f75e27
commit 62f40d202c
2 changed files with 2 additions and 1 deletions

View File

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

View File

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