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", } },