From fe7b8980f3536bb13fb283050a2ccf013beddc0b Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Thu, 22 Oct 2026 09:42:21 +0200 Subject: [PATCH 1/2] hide counter if linked to consumer --- .../koala/source/src/stores/mqtt-store.ts | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts b/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts index 002a2254f4..f0987ed9ef 100644 --- a/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts +++ b/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts @@ -4573,11 +4573,21 @@ export const useMqttStore = defineStore('mqtt', () => { counterIds: number[]; counterIdsWithChildren: number[]; }) => { - // a counter that only measures the components below it is hidden - const hidden = (id: number) => - bucket.counterIdsWithChildren.includes(id) && - Math.abs(Number(counterLocalPower.value('value', id) ?? 0)) < - COUNTER_OWN_SHARE_THRESHOLD; + const hidden = (id: number) => { + // a counter that only measures the components below it is hidden + if (bucket.counterIdsWithChildren.includes(id) && + Math.abs(Number(counterLocalPower.value('value', id) ?? 0)) < + COUNTER_OWN_SHARE_THRESHOLD + ) { + return true; + } + // a counter that is linked to a consumer does not exist in the hierarchy + const counterIds = getObjectIds.value('counter'); + if (!counterIds.includes(id)) { + return true; + } + return false; + }; return bucket.counterIds.filter((id) => !hidden(id)); }; return { From 436609bd94057729202f39bd9ac734e01fb48077 Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Thu, 22 Oct 2026 09:52:27 +0200 Subject: [PATCH 2/2] linting --- .../source/src/components/ChargePointInstantSettings.vue | 4 +++- .../components/charts/historyChart/history-chart-model.ts | 6 +----- .../web_themes/koala/source/src/stores/mqtt-store.ts | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/modules/web_themes/koala/source/src/components/ChargePointInstantSettings.vue b/packages/modules/web_themes/koala/source/src/components/ChargePointInstantSettings.vue index 7cfa0c1660..a13c204194 100644 --- a/packages/modules/web_themes/koala/source/src/components/ChargePointInstantSettings.vue +++ b/packages/modules/web_themes/koala/source/src/components/ChargePointInstantSettings.vue @@ -70,7 +70,9 @@ const acChargingEnabled = computed( const DC_POWER_FALLBACK = 300; // entspricht dc_max_current-Default 435 A const dcMaxPower = computed( -() => mqttStore.chargePointDcMaxPower(props.chargePointId).value ?? DC_POWER_FALLBACK, + () => + mqttStore.chargePointDcMaxPower(props.chargePointId).value ?? + DC_POWER_FALLBACK, ); const dcMinPower = computed(() => -dcMaxPower.value); diff --git a/packages/modules/web_themes/koala/source/src/components/charts/historyChart/history-chart-model.ts b/packages/modules/web_themes/koala/source/src/components/charts/historyChart/history-chart-model.ts index c9f60823e7..e534bc1257 100644 --- a/packages/modules/web_themes/koala/source/src/components/charts/historyChart/history-chart-model.ts +++ b/packages/modules/web_themes/koala/source/src/components/charts/historyChart/history-chart-model.ts @@ -12,11 +12,7 @@ export interface ChartComponentRef { } export type Category = - | 'chargepoint' - | 'vehicle' - | 'battery' - | 'consumer' - | 'component'; + 'chargepoint' | 'vehicle' | 'battery' | 'consumer' | 'component'; export const CONSUMER_TOTAL_LABEL = 'Verbraucher ges.'; diff --git a/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts b/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts index f0987ed9ef..8f7a1dd6f7 100644 --- a/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts +++ b/packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts @@ -4575,9 +4575,10 @@ export const useMqttStore = defineStore('mqtt', () => { }) => { const hidden = (id: number) => { // a counter that only measures the components below it is hidden - if (bucket.counterIdsWithChildren.includes(id) && + if ( + bucket.counterIdsWithChildren.includes(id) && Math.abs(Number(counterLocalPower.value('value', id) ?? 0)) < - COUNTER_OWN_SHARE_THRESHOLD + COUNTER_OWN_SHARE_THRESHOLD ) { return true; }