mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-06 04:31:37 +02:00
0.8.97
* 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:
parent
99cfdb5324
commit
9971ed7f8a
4 changed files with 15 additions and 7 deletions
11
src/app.cpp
11
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue