Browse Source

0.7.16

* next attempt to fix yield day for multiple inverters #1016
* fix export settings date #1040
* fix time on WebUI (timezone was not observed) #913 #1016
pull/1048/head
lumapu 2 years ago
parent
commit
ffe7d47b31
  1. 5
      src/CHANGES.md
  2. 2
      src/defines.h
  3. 2
      src/hm/hmInverter.h
  4. 17
      src/publisher/pubMqttIvData.h
  5. 2
      src/web/RestApi.h
  6. 4
      src/web/html/api.js
  7. 10
      src/web/html/index.html
  8. 2
      src/web/html/visualization.html

5
src/CHANGES.md

@ -1,5 +1,10 @@
# Development Changes
## 0.7.16 - 2023-07-24
* next attempt to fix yield day for multiple inverters #1016
* fix export settings date #1040
* fix time on WebUI (timezone was not observed) #913 #1016
## 0.7.15 - 2023-07-23
* add NTP sync interval #1019
* adjusted range of contrast / luminance setting #1041

2
src/defines.h

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 7
#define VERSION_PATCH 15
#define VERSION_PATCH 16
//-------------------------------------
typedef struct {

2
src/hm/hmInverter.h

@ -401,7 +401,7 @@ class Inverter {
avail = true;
if(avail) {
if(InverterStatus::OFF == status)
if(status < InverterStatus::PRODUCING)
status = InverterStatus::STARTING;
else
status = InverterStatus::WAS_ON;

17
src/publisher/pubMqttIvData.h

@ -68,6 +68,7 @@ class PubMqttIvData {
void stateStart() {
mLastIvId = 0;
mTotalFound = false;
mAllTotalFound = true;
if(!mSendList->empty()) {
mCmd = mSendList->front().cmd;
mIvSend = mSendList->front().iv;
@ -150,7 +151,8 @@ class PubMqttIvData {
mTotal[3] += mIv->getValue(mPos, rec);
break;
}
}
} else
mAllTotalFound = false;
}
} else
mIvLastRTRpub[mIv->id] = lastTs;
@ -169,6 +171,7 @@ class PubMqttIvData {
void stateSendTotals() {
uint8_t fieldId;
mRTRDataHasBeenSent = true;
if(mPos < 4) {
bool retained = true;
switch (mPos) {
@ -178,9 +181,17 @@ class PubMqttIvData {
retained = false;
break;
case 1:
if(!mAllTotalFound) {
mPos++
return;
}
fieldId = FLD_YT;
break;
case 2:
if(!mAllTotalFound) {
mPos++
return;
}
fieldId = FLD_YD;
break;
case 3:
@ -197,8 +208,6 @@ class PubMqttIvData {
mZeroValues = false;
mState = START;
}
mRTRDataHasBeenSent = true;
}
HMSYSTEM *mSys;
@ -209,7 +218,7 @@ class PubMqttIvData {
uint8_t mCmd;
uint8_t mLastIvId;
bool mSendTotals, mTotalFound;
bool mSendTotals, mTotalFound, mAllTotalFound;
float mTotal[4];
Inverter<> *mIv, *mIvSend;

2
src/web/RestApi.h

@ -184,7 +184,7 @@ class RestApi {
response = request->beginResponse(200, F("application/json; charset=utf-8"), tmp);
}
String filename = ah::getDateTimeStrFile(mApp->getTimezoneOffset());
String filename = ah::getDateTimeStrFile(gTimezone.toLocal(mApp->getTimestamp()));
filename += "_v" + String(mApp->getVersion());
response->addHeader("Content-Type", "application/octet-stream");

4
src/web/html/api.js

@ -119,6 +119,10 @@ function parseRssi(obj) {
document.getElementById("wifiicon").replaceChildren(svg(icon, 32, 32, "wifi", obj["wifi_rssi"]));
}
function toIsoDateStr(d) {
return new Date(d.getTime() + (d.getTimezoneOffset() * -60000)).toISOString().substring(0, 19).replace('T', ', ');
}
function setHide(id, hide) {
var elm = document.getElementById(id);
if(hide) {

10
src/web/html/index.html

@ -62,10 +62,6 @@
getAjax("/api/setup", apiCb, "POST", JSON.stringify(obj));
}
function ts2Span(ts) {
return span(new Date(ts * 1000).toLocaleString('de-DE'));
}
function parseGeneric(obj) {
if(exeOnce)
parseESP(obj);
@ -92,7 +88,7 @@
if(obj["ts_now"] < 1680000000)
setTime();
else
dSpan.innerHTML = date.toISOString().substring(0, 19).replace('T', ', ');
dSpan.innerHTML = toIsoDateStr(date);
}
else {
dSpan.innerHTML = "";
@ -157,7 +153,7 @@
if(false == i["is_avail"]) {
if(i["ts_last_success"] > 0) {
var date = new Date(i["ts_last_success"] * 1000);
p.append(span("-> last successful transmission: " + date.toISOString().substring(0, 19).replace('T', ', ')), br());
p.append(span("-> last successful transmission: " + toIsoDateStr(date)), br());
}
}
}
@ -190,7 +186,7 @@
function tick() {
if(0 != ts)
document.getElementById("date").innerHTML = (new Date((++ts) * 1000)).toISOString().substring(0, 19).replace('T', ', ');
document.getElementById("date").innerHTML = toIsoDateStr((new Date((++ts) * 1000)));
if(++tickCnt >= 10) {
tickCnt = 0;
getAjax('/api/index', parse);

2
src/web/html/visualization.html

@ -158,7 +158,7 @@
var ageInfo = "Last received data requested at: ";
if(ts > 0) {
var date = new Date(ts * 1000);
ageInfo += date.toISOString().substring(0, 19).replace('T', ', ');
ageInfo += toIsoDateStr(date);
}
else
ageInfo += "nothing received";

Loading…
Cancel
Save