From a136c6bdc4fd178afcac74c4b8aba0f19f5c2bdb Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Wed, 17 May 2023 09:57:43 -0700
Subject: [PATCH] Code style changes to evcc widget
---
public/locales/en/common.json | 11 ++++++-----
src/widgets/evcc/component.jsx | 25 ++++++++++++-------------
src/widgets/evcc/widget.js | 2 +-
3 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index 5dbe25a8..396fcf71 100755
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -93,11 +93,12 @@
"songs": "Songs"
},
"evcc": {
- "pvPower": "Production",
- "batterySoc": "Battery",
- "gridpower": "Grid",
- "homepower": "Consumption",
- "chargePower": "Charger"
+ "pv_power": "Production",
+ "battery_soc": "Battery",
+ "grid_power": "Grid",
+ "home_power": "Consumption",
+ "charge_power": "Charger",
+ "watt_hour": "Wh"
},
"flood": {
"download": "Download",
diff --git a/src/widgets/evcc/component.jsx b/src/widgets/evcc/component.jsx
index e7e0b663..fad37f03 100644
--- a/src/widgets/evcc/component.jsx
+++ b/src/widgets/evcc/component.jsx
@@ -8,30 +8,29 @@ export default function Component({ service }) {
const { t } = useTranslation();
const { widget } = service;
- const { data: resultData, error: resultError } = useWidgetAPI(widget, "result");
+ const { data: stateData, error: stateError } = useWidgetAPI(widget, "state");
-
- if (resultError) {
- return ;
+ if (stateError) {
+ return ;
}
- if (!resultData) {
+ if (!stateData) {
return (
,
-
-
-
-
+
+
+
+
);
}
return (
-
-
-
-
+
+
+
+
);
}
\ No newline at end of file
diff --git a/src/widgets/evcc/widget.js b/src/widgets/evcc/widget.js
index f3b22417..0c4a31ae 100644
--- a/src/widgets/evcc/widget.js
+++ b/src/widgets/evcc/widget.js
@@ -5,7 +5,7 @@ const widget = {
proxyHandler: genericProxyHandler,
mappings: {
- result: {
+ state: {
endpoint: "state",
}
},