diff --git a/src/CHANGES.md b/src/CHANGES.md index 1b1bccab..af1ecd86 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,10 @@ # Development Changes +## 0.8.97 - 2024-03-22 +* add support for newest generation of inverters with A-F in their serial number +* fix NTP and sunrise / sunset +* set default coordinates to the mid of Germany #1516 + ## 0.8.96 - 2024-03-21 * fix precision of power limit in `/live` #1517 * fix translation of `Werte ausgeben` in `settings` #1507 diff --git a/src/app.cpp b/src/app.cpp index 37b0a37a..119894f1 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -204,8 +204,13 @@ void app::regularTickers(void) { #endif /*ENABLE_SIMULATOR*/ } +//----------------------------------------------------------------------------- void app::onNtpUpdate(bool gotTime) { mNtpReceived = true; + if ((0 == mSunrise) && (0.0 != mConfig->sun.lat) && (0.0 != mConfig->sun.lon)) { + mCalculatedTimezoneOffset = (int8_t)((mConfig->sun.lon >= 0 ? mConfig->sun.lon + 7.5 : mConfig->sun.lon - 7.5) / 15) * 3600; + tickCalcSunrise(); + } } //----------------------------------------------------------------------------- @@ -236,10 +241,8 @@ void app::updateNtp(void) { } } - if ((0 == mSunrise) && (0.0 != mConfig->sun.lat) && (0.0 != mConfig->sun.lon)) { - mCalculatedTimezoneOffset = (int8_t)((mConfig->sun.lon >= 0 ? mConfig->sun.lon + 7.5 : mConfig->sun.lon - 7.5) / 15) * 3600; - tickCalcSunrise(); - } + if(mNtpReceived) + onNtpUpdate(true); mMqttReconnect = false; } diff --git a/src/config/settings.h b/src/config/settings.h index fe0053a9..e115160b 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -427,8 +427,8 @@ class settings { mCfg.ntp.port = DEF_NTP_PORT; mCfg.ntp.interval = 720; - mCfg.sun.lat = 0.0; - mCfg.sun.lon = 0.0; + mCfg.sun.lat = 51.1; // mid of Germany + mCfg.sun.lon = 10.5; // mid of Germany mCfg.sun.offsetSecMorning = 0; mCfg.sun.offsetSecEvening = 0; diff --git a/src/defines.h b/src/defines.h index 9078730f..16a1adf9 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 96 +#define VERSION_PATCH 97 //------------------------------------- typedef struct {