From 997c54edb4dd2cb285b109c57ac1a72768f3d4a0 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Fri, 8 Jul 2022 18:54:52 +0200 Subject: [PATCH] Added field to live view which shows amount of eventlog events --- src/WebApi_ws_live.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/WebApi_ws_live.cpp b/src/WebApi_ws_live.cpp index 1756a5f..4a88d16 100644 --- a/src/WebApi_ws_live.cpp +++ b/src/WebApi_ws_live.cpp @@ -67,6 +67,12 @@ void WebApiWsLiveClass::loop() addField(root, i, inv, c, FLD_IRR); } + if (inv->hasChannelFieldValue(CH0, FLD_EVT_LOG)) { + root[i][F("events")] = inv->EventLog()->getEntryCount(); + } else { + root[i][F("events")] = -1; + } + if (inv->getLastStatsUpdate() > _newestInverterTimestamp) { _newestInverterTimestamp = inv->getLastStatsUpdate(); }