From 62f40d202cc0fe516cec217b6a6db1e2a5cf6ccb Mon Sep 17 00:00:00 2001 From: Ollo Date: Fri, 15 Jan 2021 18:14:39 +0100 Subject: [PATCH] Addition color format supported --- main.lua | 1 + mqtt.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 578de3e..18abe65 100644 --- a/main.lua +++ b/main.lua @@ -175,6 +175,7 @@ function normalOperation() if (startTelnetServer ~= nil) then startTelnetServer() else + displayTime() print("NO Telent found") end setupCounter=setupCounter-1 diff --git a/mqtt.lua b/mqtt.lua index 3d45af7..c2141b8 100644 --- a/mqtt.lua +++ b/mqtt.lua @@ -9,7 +9,7 @@ function handleSingleCommand(client, topic, data) elseif (data == "OFF") then briPercent=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) green = tonumber(data:sub(4,5), 16) blue = tonumber(data:sub(6,7), 16)