* 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
This commit is contained in:
lumapu 2024-03-22 22:40:35 +01:00
parent 99cfdb5324
commit 9971ed7f8a
4 changed files with 15 additions and 7 deletions

View file

@ -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;
}