From af8e9becbf518b7bff96a76e27f6fab930a770eb Mon Sep 17 00:00:00 2001 From: Carsten Schmiemann Date: Sun, 13 Nov 2022 19:20:46 +0100 Subject: [PATCH] Fix wifiman config and ntp activation --- src/main.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c31dc75..081835f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -506,6 +506,8 @@ void setup() { json["display_language"] = display_lang; json["time_zone"] = time_zone; json["time_server"] = time_server; + json["show_graph"] = show_graph; + json["show_statistics"] = show_statistics; File configFile = Flash.open("/config.json", "w"); if (!configFile) { @@ -523,15 +525,18 @@ void setup() { //end save } - //NTP setup - #ifdef ESP32 - configTime(0, 0, time_server); - setenv("TZ", time_zone, 1); - tzset(); - #endif - #ifdef ESP8266 - configTime(time_zone, time_server); - #endif + if (display_conf_time_present) + { + //NTP setup + #ifdef ESP32 + configTime(0, 0, time_server); + setenv("TZ", time_zone, 1); + tzset(); + #endif + #ifdef ESP8266 + configTime(time_zone, time_server); + #endif + } delay(1000); //for screen display