diff --git a/main.lua b/main.lua index cadf4b1..76ac6ac 100644 --- a/main.lua +++ b/main.lua @@ -67,8 +67,11 @@ function displayTime() end function normalOperation() - -- Color is defined as GREEN, RED, BLUE - color=string.char(0,0,250) + -- use default color, if nothing is defined + if (color == nil) then + -- Color is defined as GREEN, RED, BLUE + color=string.char(0,0,250) + end connect_counter=0 -- Wait to be connect to the WiFi access point. diff --git a/webpage.lua b/webpage.lua index 1cea9c8..84f54f9 100644 --- a/webpage.lua +++ b/webpage.lua @@ -10,6 +10,11 @@ function sendWebPage(conn,answertype) if (timezoneoffset == nil) then timezoneoffset=1 end + -- Set the default color, if nothing is set + if (color == nil) then + color=string.char(0,0,250) + end + local buf="HTTP/1.1 200 OK\nServer: NodeMCU\nContent-Type: text/html\n\n" if (node.heap() < 8000) then buf = buf .. "