Skip to content

Commit

Permalink
fix: remove unused objects. fix: total battery power if battery count…
Browse files Browse the repository at this point in the history
… === 1
  • Loading branch information
slipx06 committed Nov 30, 2024
1 parent 031e92d commit b8f61b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -1379,7 +1379,6 @@ export class SunsynkPowerFlowCard extends LitElement {
*/
const data: DataDto = {
config,
viewbox,
compactMode,
viewBoxYLite,
viewBoxHeightLite,
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ export interface InverterSettings {

export interface DataDto {
config: sunsynkPowerFlowCardConfig;
viewbox;
compactMode;
viewBoxYLite;
viewBoxHeightLite;
Expand Down

0 comments on commit b8f61b6

Please sign in to comment.