Skip to content

Commit

Permalink
fix: missing aux_load1_extra
Browse files Browse the repository at this point in the history
  • Loading branch information
slipx06 committed Apr 5, 2024
1 parent c313812 commit 4aba6e5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/sunsynk-power-flow-card.js

Large diffs are not rendered by default.

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": "4.28.0",
"version": "4.28.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
2 changes: 1 addition & 1 deletion src/cards/full-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string
${data.stateAuxLoad1Extra?.getUOM()}
</text>
<text id="aux_load1_extra" x="360" y="14" class="st3 st8"
display="${data.showAux && data.additionalAuxLoad === 1 && config.entities.aux_load1_extra ? '' : 'none'}"
display="${data.showAux && [1, 2].includes(data.additionalAuxLoad) && config.entities.aux_load1_extra ? '' : 'none'}"
fill="${data.auxDynamicColourLoad1}">
${data.stateAuxLoad1Extra.toNum(1)}
${data.stateAuxLoad1Extra?.getUOM()}
Expand Down
1 change: 1 addition & 0 deletions src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const validLoadValues = [0, 1, 2, 3, 4]
export const validnonLoadValues = [0, 1, 2, 3]
export const valid3phase = [true, false]
export const validaux = [true, false]
export const validauxLoads = [0, 1, 2]
export const validGridDisconnected = ['off', '0', 'off-grid', 'off grid', 'offgrid']
export const validGridConnected = ['on', '1', 'on-grid', 'on grid', 'ongrid']

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {HomeAssistant} from 'custom-card-helpers';
import {styles} from './style';
import {CardStyle, DataDto, InverterModel, InverterSettings, sunsynkPowerFlowCardConfig,} from './types';
import defaultConfig from './defaults';
import {CARD_VERSION, valid3phase, validaux, validLoadValues, validnonLoadValues, validGridConnected, validGridDisconnected} from './const';
import {CARD_VERSION, valid3phase, validaux, validLoadValues, validnonLoadValues, validGridConnected, validGridDisconnected, validauxLoads} from './const';
import {localize} from './localize/localize';
import merge from 'lodash.merge';
import {SunSynkCardEditor} from './editor';
Expand Down Expand Up @@ -333,7 +333,7 @@ export class SunsynkPowerFlowCard extends LitElement {
}

let additionalAuxLoad = config.load?.aux_loads;
if (!validLoadValues.includes(additionalAuxLoad)) {
if (!validauxLoads.includes(additionalAuxLoad)) {
additionalAuxLoad = 0;
}

Expand Down

0 comments on commit 4aba6e5

Please sign in to comment.