Skip to content

Commit

Permalink
0.8.100
Browse files Browse the repository at this point in the history
* fix captions in `/history #1532
* fix get NTP time #1529 #1530
* fix translation #1516
  • Loading branch information
lumapu committed Mar 26, 2024
1 parent d5ed027 commit 4b75e72
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 24 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.100 - 2024-03-27
* fix captions in `/history #1532
* fix get NTP time #1529 #1530
* fix translation #1516

## 0.8.99 - 2024-03-27
* fix compilation of all environments

Expand Down
12 changes: 3 additions & 9 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,12 @@ void app::tickNtpUpdate(void) {

if (!mNtpReceived)
mNetwork->updateNtpTime();
else
else {
nxtTrig = mConfig->ntp.interval * 60; // check again in configured interval
mNtpReceived = false;
}

updateNtp();
nxtTrig = mConfig->ntp.interval * 60; // check again in 12h

// immediately start communicating
if (mSendFirst) {
mSendFirst = false;
once(std::bind(&app::tickSend, this), 1, "senOn");
}

mMqttReconnect = false;

Expand Down Expand Up @@ -532,7 +527,6 @@ void app::resetSystem(void) {
mTimestamp = 1;
#endif

mSendFirst = true;
mAllIvNotAvail = true;

mSunrise = 0;
Expand Down
1 change: 0 additions & 1 deletion src/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ class app : public IApp, public ah::Scheduler {
bool mSaveReboot = false;

uint8_t mSendLastIvId = 0;
bool mSendFirst = false;
bool mAllIvNotAvail = false;

bool mNetworkConnected = false;
Expand Down
3 changes: 1 addition & 2 deletions src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 99

#define VERSION_PATCH 100
//-------------------------------------
typedef struct {
uint8_t ch;
Expand Down
10 changes: 4 additions & 6 deletions src/network/AhoyNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class AhoyNetwork {
}

bool updateNtpTime(void) {
if(NetworkState::CONNECTED != mStatus)
if(NetworkState::GOT_IP != mStatus)
return false;

IPAddress timeServer;
if (!mUdp.connected()) {
IPAddress timeServer;
if (!WiFi.hostByName(mConfig->ntp.addr, timeServer))
return false;
if (!mUdp.connect(timeServer, mConfig->ntp.port))
Expand All @@ -71,7 +71,7 @@ class AhoyNetwork {
mUdp.onPacket([this](AsyncUDPPacket packet) {
this->handleNTPPacket(packet);
});
sendNTPpacket(timeServer);
sendNTPpacket();

return true;
}
Expand Down Expand Up @@ -173,7 +173,7 @@ class AhoyNetwork {
#endif

private:
void sendNTPpacket(IPAddress& address) {
void sendNTPpacket(void) {
//DPRINTLN(DBG_VERBOSE, F("wifi::sendNTPpacket"));
uint8_t buf[NTP_PACKET_SIZE];
memset(buf, 0, NTP_PACKET_SIZE);
Expand All @@ -188,9 +188,7 @@ class AhoyNetwork {
buf[14] = 49;
buf[15] = 52;

//mUdp.beginPacket(address, 123); // NTP request, port 123
mUdp.write(buf, NTP_PACKET_SIZE);
//mUdp.endPacket();
}

void handleNTPPacket(AsyncUDPPacket packet) {
Expand Down
2 changes: 1 addition & 1 deletion src/web/html/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h4 style="margin-bottom:0px;">Insert data into Yield per day history</h4>
return [
mlNs("polyline", {stroke: "url(#gLine)", fill: "none", points: pts}),
mlNs("polyline", {stroke: "none", fill: "url(#gFill)", points: pts2}),
mlNs("text", {x: i*.8, y: 10}, "{#MAX_DAY}: " + String(obj.max) + "W"),
mlNs("text", {x: i*.8, y: 10}, "{#MAXIMUM}: " + String(obj.max) + "W"),
mlNs("text", {x: i*.8, y: 25}, "{#LAST_VALUE}: " + String(lastVal) + "W")
]
}
Expand Down
10 changes: 5 additions & 5 deletions src/web/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@
{
"token": "BTN_INV_ADD",
"en": "add Inverter",
"de": "Wechselrichter hinzufuegen"
"de": "Wechselrichter hinzuf\u00FCgen"
},
{
"token": "INV_INPUT",
Expand All @@ -656,7 +656,7 @@
{
"token": "TAB_INPUTS",
"en": "Inputs",
"de": "Eingaenge"
"de": "Eing&auml;nge"
},
{
"token": "TAB_RADIO",
Expand Down Expand Up @@ -1579,9 +1579,9 @@
"de": "Gesamtertrag pro Tag"
},
{
"token": "MAX_DAY",
"en": "Maximum day",
"de": "Tagesmaximum"
"token": "MAXIMUM",
"en": "Maximum",
"de": "Maximum"
},
{
"token": "LAST_VALUE",
Expand Down

0 comments on commit 4b75e72

Please sign in to comment.