Skip to content

Commit

Permalink
BREAKING CHANGE: Web API Endpoint /api/eventlog/status no nested seri…
Browse files Browse the repository at this point in the history
…al object

It's not required as the  eventlog just contains events from requested inverter
  • Loading branch information
tbnobody committed Apr 20, 2023
1 parent 188d865 commit 04f62e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/WebApi_eventlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ void WebApiEventlogClass::onEventlogStatus(AsyncWebServerRequest* request)
auto inv = Hoymiles.getInverterBySerial(serial);

if (inv != nullptr) {
String serial = inv->serialString();

uint8_t logEntryCount = inv->EventLog()->getEntryCount();

root[serial]["count"] = logEntryCount;
JsonArray eventsArray = root[serial].createNestedArray("events");
root["count"] = logEntryCount;
JsonArray eventsArray = root.createNestedArray("events");

for (uint8_t logEntry = 0; logEntry < logEntryCount; logEntry++) {
JsonObject eventsObject = eventsArray.createNestedObject();
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ export default defineComponent({
fetch("/api/eventlog/status?inv=" + serial, { headers: authHeader() })
.then((response) => handleResponse(response, this.$emitter, this.$router))
.then((data) => {
this.eventLogList = data[serial];
this.eventLogList = data;
this.eventLogLoading = false;
});
Expand Down

0 comments on commit 04f62e0

Please sign in to comment.