Config UI: show static grid export limit on hems card (#32634)

This commit is contained in:
andig 2026-08-10 11:10:31 +02:00 • committed by GitHub
parent a237f698d0
commit 7b8e6e1f74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 3 deletions

View file

@ -210,6 +210,7 @@ export default {
case "solarForecast":
case "dimLimit":
case "curtailLimit":
case "exportLimit":
return this.fmtW(value);
case "energy":
case "returnEnergy":

View file

@ -846,14 +846,18 @@ export default defineComponent({
return store.state?.hems;
},
hemsTags(): DeviceTags {
const result: DeviceTags = {};
const exportLimit = store.state?.gridExportLimit || 0;
if (exportLimit > 0) {
result["exportLimit"] = { value: exportLimit };
}
if (this.hemsDevices.length === 0 && !this.hems?.config?.configured) {
return { configured: { value: false } };
return exportLimit > 0 ? result : { configured: { value: false } };
}
const status = store.state?.hems?.status;
if (!status) {
return { configured: { value: true } };
return { ...result, configured: { value: true } };
}
const result: DeviceTags = {};
if (status.dimmed && status.maxConsumptionPower) {
result["dimLimit"] = {
value: status.maxConsumptionPower,

View file

@ -219,6 +219,7 @@
"enabled": "Ladebereit",
"energy": "Energie",
"events": "Ereignisse",
"exportLimit": "Einspeiselimit",
"feedinPrice": "Einspeisevergütung",
"forecast": "Vorhersage",
"gridPrice": "Netzpreis",

View file

@ -219,6 +219,7 @@
"enabled": "Enabled",
"energy": "Energy",
"events": "Events",
"exportLimit": "Grid export limit",
"feedinPrice": "Feed-in price",
"forecast": "Forecast",
"gridPrice": "Grid price",

View file

@ -159,6 +159,12 @@ maxconsumptionpower:
await hemsModal.getByRole("button", { name: "Close" }).click();
await expectModalHidden(hemsModal);
// card shows the static limit instead of unconfigured
const hemsCard = page.getByTestId("hems");
await expect(hemsCard).toContainText("Grid export limit");
await expect(hemsCard).toContainText("7.0 kW");
await expect(hemsCard).not.toContainText("Configured");
// persisted across restart
await restart(CONFIG);
await page.reload();