diff --git a/esp8266-fastled-iot-webserver.ino b/esp8266-fastled-iot-webserver.ino index 6cac09e77475e8ada40edc241b3044cbcbf3d02e..69de96c373a841a9074db89c5f3ab4ea832a9420 100644 --- a/esp8266-fastled-iot-webserver.ino +++ b/esp8266-fastled-iot-webserver.ino @@ -1325,7 +1325,6 @@ void loop() { // dnsServer.processNextRequest(); // webSocketsServer.loop(); - wifiManager.process(); #ifdef ENABLE_ALEXA_SUPPORT espalexa.loop(); #else @@ -1335,6 +1334,8 @@ void loop() { MDNS.update(); #endif // ENABLE_MULTICAST_DNS + wifiManager.process(); + static bool hasConnected = false; EVERY_N_SECONDS(1) { if (wifiManager.getLastConxResult() != WL_CONNECTED) { @@ -1481,6 +1482,8 @@ void saveConfig(bool save) { delay(200); EEPROM.commit(); EEPROM.end(); + + save_config = false; } } @@ -1653,9 +1656,10 @@ void setPattern(uint8_t value) currentPatternIndex = value; - if (autoplay != 1) + if (autoplay != 1) { cfg.currentPatternIndex = currentPatternIndex; save_config = true; + } broadcastInt("pattern", currentPatternIndex); } @@ -1702,15 +1706,6 @@ void adjustBrightness(bool up) brightnessIndex--; setBrightness(brightnessMap[brightnessIndex]); -/* brightness = brightnessMap[brightnessIndex]; - - FastLED.setBrightness(brightness); - - EEPROM.write(SETTING_BRIGTHNESS, brightness); - EEPROM.commit(); - - broadcastInt("brightness", brightness); -*/ } void setBrightness(uint8_t value)