From 48f0640bd97edff9963a353674e781e5d59b7025 Mon Sep 17 00:00:00 2001 From: Ricardo Bartels <ricardo@bitchbrothers.com> Date: Thu, 31 Dec 2020 13:32:27 +0100 Subject: [PATCH] fixes setting save_config correctly --- esp8266-fastled-iot-webserver.ino | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/esp8266-fastled-iot-webserver.ino b/esp8266-fastled-iot-webserver.ino index 6cac09e..69de96c 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) -- GitLab