mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-03 03:01:40 +02:00
0.8.86
* RestAPI check for parent element to be JsonObject #1449 * fix translation #1448 #1442 * fix reset values when inverter status is 'not available' #1035 #1437
This commit is contained in:
parent
b6afec1c3a
commit
6d887e1540
6 changed files with 54 additions and 31 deletions
|
@ -1,5 +1,10 @@
|
||||||
# Development Changes
|
# Development Changes
|
||||||
|
|
||||||
|
## 0.8.86 - 2024-02-23
|
||||||
|
* RestAPI check for parent element to be JsonObject #1449
|
||||||
|
* fix translation #1448 #1442
|
||||||
|
* fix reset values when inverter status is 'not available' #1035 #1437
|
||||||
|
|
||||||
## 0.8.85 - 2024-02-22
|
## 0.8.85 - 2024-02-22
|
||||||
* possible fix of MqTT fix "total values are sent to often" #1421
|
* possible fix of MqTT fix "total values are sent to often" #1421
|
||||||
* fix translation #1442
|
* fix translation #1442
|
||||||
|
|
|
@ -468,7 +468,7 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) {
|
||||||
continue; // skip to next inverter
|
continue; // skip to next inverter
|
||||||
|
|
||||||
if (checkAvail) {
|
if (checkAvail) {
|
||||||
if (!iv->isAvailable())
|
if (iv->isAvailable())
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 8
|
||||||
#define VERSION_PATCH 85
|
#define VERSION_PATCH 86
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -141,7 +141,7 @@ class RestApi {
|
||||||
DPRINTLN(DBG_VERBOSE, "onApiPostBody");
|
DPRINTLN(DBG_VERBOSE, "onApiPostBody");
|
||||||
|
|
||||||
if(0 == index) {
|
if(0 == index) {
|
||||||
if(NULL != mTmpBuf)
|
if(nullptr != mTmpBuf)
|
||||||
delete[] mTmpBuf;
|
delete[] mTmpBuf;
|
||||||
mTmpBuf = new uint8_t[total+1];
|
mTmpBuf = new uint8_t[total+1];
|
||||||
mTmpSize = total;
|
mTmpSize = total;
|
||||||
|
@ -154,11 +154,14 @@ class RestApi {
|
||||||
|
|
||||||
DynamicJsonDocument json(1000);
|
DynamicJsonDocument json(1000);
|
||||||
|
|
||||||
DeserializationError err = deserializeJson(json, reinterpret_cast<const char*>(mTmpBuf), mTmpSize);
|
|
||||||
JsonObject obj = json.as<JsonObject>();
|
|
||||||
|
|
||||||
AsyncJsonResponse* response = new AsyncJsonResponse(false, 200);
|
AsyncJsonResponse* response = new AsyncJsonResponse(false, 200);
|
||||||
JsonObject root = response->getRoot();
|
JsonObject root = response->getRoot();
|
||||||
|
DeserializationError err = deserializeJson(json, reinterpret_cast<const char*>(mTmpBuf), mTmpSize);
|
||||||
|
if(!json.is<JsonObject>())
|
||||||
|
root[F("error")] = F(DESER_FAILED);
|
||||||
|
else {
|
||||||
|
JsonObject obj = json.as<JsonObject>();
|
||||||
|
|
||||||
root[F("success")] = (err) ? false : true;
|
root[F("success")] = (err) ? false : true;
|
||||||
if(!err) {
|
if(!err) {
|
||||||
String path = request->url().substring(5);
|
String path = request->url().substring(5);
|
||||||
|
@ -179,11 +182,12 @@ class RestApi {
|
||||||
default: root[F("error")] = F(DESER_FAILED); break;
|
default: root[F("error")] = F(DESER_FAILED); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
delete[] mTmpBuf;
|
delete[] mTmpBuf;
|
||||||
mTmpBuf = NULL;
|
mTmpBuf = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void getNotFound(JsonObject obj, String url) {
|
void getNotFound(JsonObject obj, String url) {
|
||||||
|
@ -974,7 +978,7 @@ class RestApi {
|
||||||
uint32_t mTimezoneOffset = 0;
|
uint32_t mTimezoneOffset = 0;
|
||||||
uint32_t mHeapFree = 0, mHeapFreeBlk = 0;
|
uint32_t mHeapFree = 0, mHeapFreeBlk = 0;
|
||||||
uint8_t mHeapFrag = 0;
|
uint8_t mHeapFrag = 0;
|
||||||
uint8_t *mTmpBuf = NULL;
|
uint8_t *mTmpBuf = nullptr;
|
||||||
uint32_t mTmpSize = 0;
|
uint32_t mTmpSize = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
});
|
});
|
||||||
document.getElementById("scroll").addEventListener("click", function() {
|
document.getElementById("scroll").addEventListener("click", function() {
|
||||||
mAutoScroll = !mAutoScroll;
|
mAutoScroll = !mAutoScroll;
|
||||||
this.value = (mAutoScroll) ? "autoscroll" : "manual scroll";
|
this.value = (mAutoScroll) ? "{#BTN_AUTOSCROLL}" : "{#BTN_MANUALSCROLL}";
|
||||||
});
|
});
|
||||||
document.getElementById("copy").addEventListener("click", function() {
|
document.getElementById("copy").addEventListener("click", function() {
|
||||||
con.value = version + " - " + build + "\n---------------\n" + con.value;
|
con.value = version + " - " + build + "\n---------------\n" + con.value;
|
||||||
|
@ -80,10 +80,10 @@
|
||||||
try {
|
try {
|
||||||
return document.execCommand("copy"); // Security exception may be thrown by some browsers.
|
return document.execCommand("copy"); // Security exception may be thrown by some browsers.
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
alert("Copy to clipboard failed" + ex);
|
alert("CLIPBOARD_FAILED " + ex);
|
||||||
} finally {
|
} finally {
|
||||||
document.body.removeChild(ta);
|
document.body.removeChild(ta);
|
||||||
alert("Copied to clipboard");
|
alert("{#COPIED_TO_CLIPBOARD}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -883,6 +883,11 @@
|
||||||
"en": "autoscroll",
|
"en": "autoscroll",
|
||||||
"de": "automatisch scrollen"
|
"de": "automatisch scrollen"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"token": "BTN_MANUALSCROLL",
|
||||||
|
"en": "manual scroll",
|
||||||
|
"de": "manuell scrollen"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"token": "BTN_COPY",
|
"token": "BTN_COPY",
|
||||||
"en": "copy",
|
"en": "copy",
|
||||||
|
@ -897,12 +902,21 @@
|
||||||
"token": "UPTIME",
|
"token": "UPTIME",
|
||||||
"en": "uptime",
|
"en": "uptime",
|
||||||
"de": "Laufzeit"
|
"de": "Laufzeit"
|
||||||
}
|
},
|
||||||
,
|
|
||||||
{
|
{
|
||||||
"token": "DAYS",
|
"token": "DAYS",
|
||||||
"en": "days",
|
"en": "days",
|
||||||
"de": "Tage"
|
"de": "Tage"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"token": "COPIED_TO_CLIPBOARD",
|
||||||
|
"en": "Copied to clipboard",
|
||||||
|
"de": "in die Zwischenablage kopiert"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"token": "CLIPBOARD_FAILED",
|
||||||
|
"en": "Copy failed",
|
||||||
|
"de": "kopieren fehlgeschlagen"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue