Skip to content

Commit

Permalink
fix: short path when wide: true and mppts:1 closes #569
Browse files Browse the repository at this point in the history
fix: off_threshold not applied to grid export
fix: ac temp position on wide view
  • Loading branch information
slipx06 committed Dec 7, 2024
1 parent 118cdbf commit 10ddfc1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 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.1.4",
"version": "6.1.5",
"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
10 changes: 7 additions & 3 deletions src/cards/full-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string
</text>
<svg id="pv1-flow">
<path id="pv1-line"
d="${config.solar.mppts === 1 ? 'M 86 175 M 155 250 L 96 250 Q 86 250 86 240 L 86 56 H 70' : 'M 86 162 L 86 56 Q 86 56 86 56 L 70 56'}"
d="${config.solar.mppts === 1
? config.wide
? 'M 86 175 M 278 250 L 96 250 Q 86 250 86 240 L 86 56 H 70'
: 'M 86 175 M 155 250 L 96 250 Q 86 250 86 240 L 86 56 H 70'
: 'M 86 162 L 86 56 Q 86 56 86 56 L 70 56'}"
class="${!config.show_solar ? 'st12' : ''}" fill="none"
stroke="${data.solarColour}" stroke-width="${data.pv1LineWidth}" stroke-miterlimit="10"
pointer-events="stroke"/>
Expand Down Expand Up @@ -2934,8 +2938,8 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string
</text>
</a>
<a href="#" @click=${(e) => Utils.handlePopup(e, config.entities.radiator_temp_91)}>
<text id="ac_temp" x="${config.solar?.mppts === 4 ? '110' : '134'}"
y="${config.solar?.mppts === 4 ? '237' : '153'}" class="st3 left-align"
<text id="ac_temp" x="${config.solar?.mppts === 4 && !config.wide ? '110' : '134'}"
y="${config.solar?.mppts === 4 && !config.wide ? '237' : '153'}" class="st3 left-align"
fill="${data.inverterColour}"
display="${config.entities?.radiator_temp_91 && data.stateRadiatorTemp.isValid() ? '' : 'none'}">AC:
${data.stateRadiatorTemp.toNum(1)}°
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,13 @@ export class SunsynkPowerFlowCard extends LitElement {

let gridColour: string;
switch (true) {
case totalGridPower < 0:
case totalGridPower < -Utils.toNum(config.grid?.off_threshold, 0):
gridColour = gridExportColour;
break;
case totalGridPower >= 0 && totalGridPower <= Utils.toNum(config.grid?.off_threshold, 0):
case totalGridPower >= -Utils.toNum(config.grid?.off_threshold, 0) && totalGridPower <= Utils.toNum(config.grid?.off_threshold, 0):
gridColour = noGridColour;
break;
default:
default: // Import
gridColour = gridImportColour;
break;
}
Expand Down

0 comments on commit 10ddfc1

Please sign in to comment.