Browse Source

0.8.100

* fix captions in `/history #1532
* fix get NTP time #1529 #1530
* fix translation #1516
pull/1549/head
lumapu 10 months ago
parent
commit
4b75e72bf3
  1. 5
      src/CHANGES.md
  2. 12
      src/app.cpp
  3. 1
      src/app.h
  4. 3
      src/defines.h
  5. 10
      src/network/AhoyNetwork.h
  6. 2
      src/web/html/history.html
  7. 10
      src/web/lang.json

5
src/CHANGES.md

@ -1,5 +1,10 @@
# Development Changes # 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 ## 0.8.99 - 2024-03-27
* fix compilation of all environments * fix compilation of all environments

12
src/app.cpp

@ -245,17 +245,12 @@ void app::tickNtpUpdate(void) {
if (!mNtpReceived) if (!mNtpReceived)
mNetwork->updateNtpTime(); mNetwork->updateNtpTime();
else else {
nxtTrig = mConfig->ntp.interval * 60; // check again in configured interval
mNtpReceived = false; mNtpReceived = false;
}
updateNtp(); 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; mMqttReconnect = false;
@ -532,7 +527,6 @@ void app::resetSystem(void) {
mTimestamp = 1; mTimestamp = 1;
#endif #endif
mSendFirst = true;
mAllIvNotAvail = true; mAllIvNotAvail = true;
mSunrise = 0; mSunrise = 0;

1
src/app.h

@ -440,7 +440,6 @@ class app : public IApp, public ah::Scheduler {
bool mSaveReboot = false; bool mSaveReboot = false;
uint8_t mSendLastIvId = 0; uint8_t mSendLastIvId = 0;
bool mSendFirst = false;
bool mAllIvNotAvail = false; bool mAllIvNotAvail = false;
bool mNetworkConnected = false; bool mNetworkConnected = false;

3
src/defines.h

@ -13,8 +13,7 @@
//------------------------------------- //-------------------------------------
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 8 #define VERSION_MINOR 8
#define VERSION_PATCH 99 #define VERSION_PATCH 100
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {
uint8_t ch; uint8_t ch;

10
src/network/AhoyNetwork.h

@ -57,11 +57,11 @@ class AhoyNetwork {
} }
bool updateNtpTime(void) { bool updateNtpTime(void) {
if(NetworkState::CONNECTED != mStatus) if(NetworkState::GOT_IP != mStatus)
return false; return false;
IPAddress timeServer;
if (!mUdp.connected()) { if (!mUdp.connected()) {
IPAddress timeServer;
if (!WiFi.hostByName(mConfig->ntp.addr, timeServer)) if (!WiFi.hostByName(mConfig->ntp.addr, timeServer))
return false; return false;
if (!mUdp.connect(timeServer, mConfig->ntp.port)) if (!mUdp.connect(timeServer, mConfig->ntp.port))
@ -71,7 +71,7 @@ class AhoyNetwork {
mUdp.onPacket([this](AsyncUDPPacket packet) { mUdp.onPacket([this](AsyncUDPPacket packet) {
this->handleNTPPacket(packet); this->handleNTPPacket(packet);
}); });
sendNTPpacket(timeServer); sendNTPpacket();
return true; return true;
} }
@ -173,7 +173,7 @@ class AhoyNetwork {
#endif #endif
private: private:
void sendNTPpacket(IPAddress& address) { void sendNTPpacket(void) {
//DPRINTLN(DBG_VERBOSE, F("wifi::sendNTPpacket")); //DPRINTLN(DBG_VERBOSE, F("wifi::sendNTPpacket"));
uint8_t buf[NTP_PACKET_SIZE]; uint8_t buf[NTP_PACKET_SIZE];
memset(buf, 0, NTP_PACKET_SIZE); memset(buf, 0, NTP_PACKET_SIZE);
@ -188,9 +188,7 @@ class AhoyNetwork {
buf[14] = 49; buf[14] = 49;
buf[15] = 52; buf[15] = 52;
//mUdp.beginPacket(address, 123); // NTP request, port 123
mUdp.write(buf, NTP_PACKET_SIZE); mUdp.write(buf, NTP_PACKET_SIZE);
//mUdp.endPacket();
} }
void handleNTPPacket(AsyncUDPPacket packet) { void handleNTPPacket(AsyncUDPPacket packet) {

2
src/web/html/history.html

@ -136,7 +136,7 @@
return [ return [
mlNs("polyline", {stroke: "url(#gLine)", fill: "none", points: pts}), mlNs("polyline", {stroke: "url(#gLine)", fill: "none", points: pts}),
mlNs("polyline", {stroke: "none", fill: "url(#gFill)", points: pts2}), 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") mlNs("text", {x: i*.8, y: 25}, "{#LAST_VALUE}: " + String(lastVal) + "W")
] ]
} }

10
src/web/lang.json

@ -631,7 +631,7 @@
{ {
"token": "BTN_INV_ADD", "token": "BTN_INV_ADD",
"en": "add Inverter", "en": "add Inverter",
"de": "Wechselrichter hinzufuegen" "de": "Wechselrichter hinzuf\u00FCgen"
}, },
{ {
"token": "INV_INPUT", "token": "INV_INPUT",
@ -656,7 +656,7 @@
{ {
"token": "TAB_INPUTS", "token": "TAB_INPUTS",
"en": "Inputs", "en": "Inputs",
"de": "Eingaenge" "de": "Eingänge"
}, },
{ {
"token": "TAB_RADIO", "token": "TAB_RADIO",
@ -1579,9 +1579,9 @@
"de": "Gesamtertrag pro Tag" "de": "Gesamtertrag pro Tag"
}, },
{ {
"token": "MAX_DAY", "token": "MAXIMUM",
"en": "Maximum day", "en": "Maximum",
"de": "Tagesmaximum" "de": "Maximum"
}, },
{ {
"token": "LAST_VALUE", "token": "LAST_VALUE",

Loading…
Cancel
Save