From 664d91d6f49697a15b409dddf4ec647c60c443c0 Mon Sep 17 00:00:00 2001 From: rxf Date: Sun, 13 Apr 2025 00:08:05 +0200 Subject: [PATCH] =?UTF-8?q?DST=20nun=20auf=203600=20Restart=20t=C3=A4glich?= =?UTF-8?q?=20um=200h00?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 6 ++++++ src/main.h | 1 + src/version.h | 10 +++++++--- src/weifi.h | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f374460..f005a3a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -160,4 +160,10 @@ void updateDateTime(struct tm tinfo) { int year = tinfo.tm_year + 1900; sprintf(date, "%s, %d. %s %d", wday[wd], day, month[mo], year); setDateTime(time, date); + // Check if day has just changed + if (timeinfo.tm_hour = 0 && timeinfo.tm_min == 0 && timeinfo.tm_sec == 0) { + esp_restart(); + } + + } diff --git a/src/main.h b/src/main.h index ab0e0bf..2e12bf8 100644 --- a/src/main.h +++ b/src/main.h @@ -20,6 +20,7 @@ TimerHandle_t wifiReconnectTimer; int bmeReadTime = 10000; int updateTime = 30000; struct tm timeinfo; +int oldDay = 0; #else extern const char* wday[7]; extern const char* month[12]; diff --git a/src/version.h b/src/version.h index 3351264..4f6c49a 100644 --- a/src/version.h +++ b/src/version.h @@ -1,11 +1,15 @@ // Versionsgeschichte -#define VERSION "1.6.3" -#define VDATE "2024-10-27" -#define VTIME "09:00 UTC" +#define VERSION "1.6.5" +#define VDATE "2025-04-12" +#define VTIME "23:00 UTC" /* Version Date Author +1.6.4 2025-04-12 rxf + - Neuer Versuchmit DST + - täglich um 0h00 Restart + 1.6.3 2024-10-27 rxf - Daylight-Saving-Time (DST) berücksichtigt (DST-Offset = 0!!) diff --git a/src/weifi.h b/src/weifi.h index 0f0c860..0ef611c 100644 --- a/src/weifi.h +++ b/src/weifi.h @@ -17,7 +17,7 @@ #ifdef WEIFI const char *ntpServer = "pool.ntp.org"; const long gmtOffset_sec = 3600; -const int daylightOffset_sec = 0; +const int daylightOffset_sec = 3600; WebServer server(80);