diff --git a/main.lua b/main.lua index 6e5a31e..81745e1 100644 --- a/main.lua +++ b/main.lua @@ -47,6 +47,17 @@ function displayTime() time = getTime(sec, timezoneoffset) print("Local time : " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second) words = display_timestat(time.hour, time.minute) + + if ((words.min1 == 1) and (color1 ~= nil)) then + color=color1 + elseif ((words.min2 == 1) and (color2 ~= nil)) then + color=color2 + elseif ((words.min3 == 1) and (color3 ~= nil)) then + color=color1 + elseif ((words.min4 == 1) and (color4 ~= nil)) then + color=color4 + end + ledBuf = generateLEDs(words, color) -- Write the buffer to the LEDs ws2812.write(ledBuf) diff --git a/webpage.lua b/webpage.lua index ebe7ddb..e22b378 100644 --- a/webpage.lua +++ b/webpage.lua @@ -1,6 +1,7 @@ ------------- --- The webpage for the Webserver function sendWebPage(conn,answertype) + if (ssid == nil) then ssid="Not set" end @@ -31,6 +32,28 @@ function sendWebPage(conn,answertype) local hexColor2 = "#" .. string.format("%02x",string.byte(color2,1)) .. string.format("%02x",string.byte(color2,2)) .. string.format("%02x",string.byte(color2,3)) local hexColor3 = "#" .. string.format("%02x",string.byte(color3,1)) .. string.format("%02x",string.byte(color3,2)) .. string.format("%02x",string.byte(color3,3)) local hexColor4 = "#" .. string.format("%02x",string.byte(color4,1)) .. string.format("%02x",string.byte(color4,2)) .. string.format("%02x",string.byte(color4,3)) + + + -- hack for the second part of the page + buf=nil + if (answertype==10) then + buf = "