From b4afca56306c32c476e2736542fd949aa2add339 Mon Sep 17 00:00:00 2001 From: Lorenz Nimmervoll <40146720150346@litec.ac.at> Date: Mon, 3 Feb 2020 16:40:16 +0100 Subject: [PATCH] fixed issue with with compiling when using no alexa stuff, added espalexa.loop() to the main loop --- esp8266-nanoleaf-webserver.ino | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/esp8266-nanoleaf-webserver.ino b/esp8266-nanoleaf-webserver.ino index 18c32a1..b79f626 100644 --- a/esp8266-nanoleaf-webserver.ino +++ b/esp8266-nanoleaf-webserver.ino @@ -486,7 +486,9 @@ void setup() { String g = webServer.arg("g"); String b = webServer.arg("b"); setSolidColor(r.toInt(), g.toInt(), b.toInt()); + #ifdef ENABLE_ALEXA_SUPPORT alexa_main->setColor(r.toInt(), g.toInt(), b.toInt()); + #endif sendString(String(solidColor.r) + "," + String(solidColor.g) + "," + String(solidColor.b)); }); @@ -517,7 +519,9 @@ void setup() { webServer.on("/brightness", HTTP_POST, []() { String value = webServer.arg("value"); setBrightness(value.toInt()); + #ifdef ENABLE_ALEXA_SUPPORT alexa_main->setValue(brightness); + #endif sendInt(brightness); }); @@ -617,8 +621,11 @@ void loop() { // dnsServer.processNextRequest(); // webSocketsServer.loop(); +#ifdef ENABLE_ALEXA_SUPPORT + espalexa.loop(); +#else webServer.handleClient(); - +#endif // handleIrInput(); if (power == 0) {