From b8f61b65d76b9d25638bd9b09f136621c96250fa Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Sat, 30 Nov 2024 14:17:44 +0200 Subject: [PATCH] fix: remove unused objects. fix: total battery power if battery count === 1 --- src/index.ts | 9 ++++----- src/types.ts | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index faa8646a..2fa0a184 100644 --- a/src/index.ts +++ b/src/index.ts @@ -694,7 +694,9 @@ export class SunsynkPowerFlowCard extends LitElement { let maximumSOC2 = stateSOCEndOfCharge2.toNum() || maximumSOC; maximumSOC2 = Math.max(50, Math.min(maximumSOC2, 100)); - const batteryPowerTotal = batteryPower + battery2Power; + const batteryPowerTotal = batteryCount === 2 + ? batteryPower + battery2Power + : batteryPower; //calculate battery capacity let batteryCapacity: number = 0; @@ -1333,9 +1335,7 @@ export class SunsynkPowerFlowCard extends LitElement { customGridIconColour = gridColour; break; } - - const viewbox = config.viewbox || '0 0 483 408'; - + let viewBoxYLite:string; let viewBoxHeightLite:string; switch (true) { @@ -1379,7 +1379,6 @@ export class SunsynkPowerFlowCard extends LitElement { */ const data: DataDto = { config, - viewbox, compactMode, viewBoxYLite, viewBoxHeightLite, diff --git a/src/types.ts b/src/types.ts index 58dd4d32..8453b3ea 100644 --- a/src/types.ts +++ b/src/types.ts @@ -339,7 +339,6 @@ export interface InverterSettings { export interface DataDto { config: sunsynkPowerFlowCardConfig; - viewbox; compactMode; viewBoxYLite; viewBoxHeightLite;