Skip to content

Commit

Permalink
fix: battery flow when using two batteries. closes #609
Browse files Browse the repository at this point in the history
  • Loading branch information
slipx06 committed Jan 25, 2025
1 parent 4288c32 commit 7f3c1a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sunsynk-power-flow-card",
"version": "6.5.0",
"version": "6.5.1",
"description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.",
"main": "sunsynk-power-flow-card.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/cards/compact-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str
pointer-events="stroke"/>
<circle id="power-dot-discharge" cx="0" cy="0"
r="${Math.min(2 + data.batLineWidth + Math.max(data.minLineWidth - 2, 0), 8)}"
fill="${data.batteryPower < 0 || data.batteryPower === 0 ? 'transparent' : `${data.batteryColour}`}">
fill="${data.batteryPowerTotal < 0 || data.batteryPowerTotal === 0 ? 'transparent' : `${data.batteryColour}`}">
<animateMotion dur="${data.durationCur['battery']}s" repeatCount="indefinite"
keyPoints=${config.battery.invert_flow === true ? Utils.invertKeyPoints("1;0") : "1;0"}
keyTimes="0;1" calcMode="linear">
Expand All @@ -1163,7 +1163,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str
</circle>
<circle id="power-dot-charge" cx="0" cy="0"
r="${Math.min(2 + data.batLineWidth + Math.max(data.minLineWidth - 2, 0), 8)}"
fill="${data.batteryPower > 0 || data.batteryPower === 0 ? 'transparent' : `${config.battery.dynamic_colour ? data.flowBatColour : data.batteryColour}`}">
fill="${data.batteryPowerTotal > 0 || data.batteryPowerTotal === 0 ? 'transparent' : `${config.battery.dynamic_colour ? data.flowBatColour : data.batteryColour}`}">
<animateMotion dur="${data.durationCur['battery']}s" repeatCount="indefinite"
keyPoints=${config.battery.invert_flow === true ? Utils.invertKeyPoints("0;1") : "0;1"}
keyTimes="0;1" calcMode="linear">
Expand Down
4 changes: 2 additions & 2 deletions src/cards/full-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string
pointer-events="stroke"/>
<circle id="power-dot-discharge" cx="0" cy="0"
r="${Math.min(2 + data.batLineWidth + Math.max(data.minLineWidth - 2, 0), 8)}"
fill="${data.batteryPower < 0 || data.batteryPower === 0 ? 'transparent' : `${data.batteryColour}`}">
fill="${data.batteryPowerTotal < 0 || data.batteryPowerTotal === 0 ? 'transparent' : `${data.batteryColour}`}">
<animateMotion dur="${data.durationCur['battery']}s" repeatCount="indefinite"
keyPoints=${config.battery.invert_flow === true ? Utils.invertKeyPoints("1;0") : "1;0"}
keyTimes="0;1" calcMode="linear">
Expand All @@ -1069,7 +1069,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string
</circle>
<circle id="power-dot-charge" cx="0" cy="0"
r="${Math.min(2 + data.batLineWidth + Math.max(data.minLineWidth - 2, 0), 8)}"
fill="${data.batteryPower > 0 || data.batteryPower === 0 ? 'transparent' : `${config.battery.dynamic_colour ? data.flowBatColour : data.batteryColour}`}">
fill="${data.batteryPowerTotal > 0 || data.batteryPowerTotal === 0 ? 'transparent' : `${config.battery.dynamic_colour ? data.flowBatColour : data.batteryColour}`}">
<animateMotion dur="${data.durationCur['battery']}s" repeatCount="indefinite"
keyPoints=${config.battery.invert_flow === true ? Utils.invertKeyPoints("0;1") : "0;1"}
keyTimes="0;1" calcMode="linear">
Expand Down

0 comments on commit 7f3c1a8

Please sign in to comment.