Skip to content

Commit

Permalink
0.8.97
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
lumapu committed Mar 22, 2024
1 parent 99cfdb5 commit 9971ed7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 7 additions & 4 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/config/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 96
#define VERSION_PATCH 97

//-------------------------------------
typedef struct {
Expand Down

0 comments on commit 9971ed7

Please sign in to comment.