From fec84fd0485e598ca33b6460e6305f2fd82bb622 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Tue, 15 Nov 2022 21:52:10 +0100 Subject: [PATCH] Show custom string name in Live View --- src/WebApi_ws_live.cpp | 6 ++++++ webapp/src/components/InverterChannelInfo.vue | 7 +++++-- webapp/src/types/LiveDataStatus.ts | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/WebApi_ws_live.cpp b/src/WebApi_ws_live.cpp index cc5e0bf5..91dc62c8 100644 --- a/src/WebApi_ws_live.cpp +++ b/src/WebApi_ws_live.cpp @@ -102,6 +102,12 @@ void WebApiWsLiveClass::generateJsonResponse(JsonVariant& root) // Loop all channels for (uint8_t c = 0; c <= inv->Statistics()->getChannelCount(); c++) { + if (c > 0) { + INVERTER_CONFIG_T* inv_cfg = Configuration.getInverterConfig(inv->serial()); + if (inv_cfg != nullptr) { + invObject[String(c)][F("name")]["u"] = inv_cfg->channel[c - 1].Name; + } + } addField(invObject, i, inv, c, FLD_PAC); addField(invObject, i, inv, c, FLD_UAC); addField(invObject, i, inv, c, FLD_IAC); diff --git a/webapp/src/components/InverterChannelInfo.vue b/webapp/src/components/InverterChannelInfo.vue index e1144dac..dc277910 100644 --- a/webapp/src/components/InverterChannelInfo.vue +++ b/webapp/src/components/InverterChannelInfo.vue @@ -1,6 +1,9 @@