From b159c312589013202a40270f5a95135f428f4d8b Mon Sep 17 00:00:00 2001 From: Philipp Sandhaus Date: Fri, 20 Oct 2023 22:14:45 +0200 Subject: [PATCH] Display efficiency measuremnt for Huawei AC charger in % in web interface --- src/WebApi_Huawei.cpp | 2 +- src/WebApi_ws_Huawei.cpp | 2 +- webapp/src/components/HuaweiView.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WebApi_Huawei.cpp b/src/WebApi_Huawei.cpp index 2a7689aee..691c6504f 100644 --- a/src/WebApi_Huawei.cpp +++ b/src/WebApi_Huawei.cpp @@ -50,7 +50,7 @@ void WebApiHuaweiClass::getJsonData(JsonObject& root) { root[F("input_temp")]["u"] = "°C"; root[F("output_temp")]["v"] = rp->output_temp; root[F("output_temp")]["u"] = "°C"; - root[F("efficiency")]["v"] = rp->efficiency; + root[F("efficiency")]["v"] = rp->efficiency * 100; root[F("efficiency")]["u"] = "%"; } diff --git a/src/WebApi_ws_Huawei.cpp b/src/WebApi_ws_Huawei.cpp index 1c3873bf5..4cf8eb841 100644 --- a/src/WebApi_ws_Huawei.cpp +++ b/src/WebApi_ws_Huawei.cpp @@ -96,7 +96,7 @@ void WebApiWsHuaweiLiveClass::generateJsonResponse(JsonVariant& root) root[F("input_temp")]["u"] = "°C"; root[F("output_temp")]["v"] = rp->output_temp; root[F("output_temp")]["u"] = "°C"; - root[F("efficiency")]["v"] = rp->efficiency; + root[F("efficiency")]["v"] = rp->efficiency * 100; root[F("efficiency")]["u"] = "%"; } diff --git a/webapp/src/components/HuaweiView.vue b/webapp/src/components/HuaweiView.vue index a9ca8067c..a0917ebb8 100644 --- a/webapp/src/components/HuaweiView.vue +++ b/webapp/src/components/HuaweiView.vue @@ -70,7 +70,7 @@ {{ $t('huawei.efficiency') }} - {{ huaweiData.efficiency.v.toFixed(3) }} + {{ huaweiData.efficiency.v.toFixed(1) }} {{ huaweiData.efficiency.u }}