Skip to content

Commit

Permalink
fix: add grid name to custom and lite card closes #466
Browse files Browse the repository at this point in the history
fix: apply off_threshold to grid power closes #465
docs: update sunsynk full example
  • Loading branch information
slipx06 committed Jun 1, 2024
1 parent 6752b22 commit e2ac158
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dist/sunsynk-power-flow-card.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/examples/sunsynk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Full Configuration (All Options)
dynamic_colour: true
linear_gradient: true
animate: true
path_threshold: 100
solar:
colour: orange
show_daily: true
Expand All @@ -237,6 +238,7 @@ Full Configuration (All Options)
display_mode: 1
dynamic_colour: true
efficiency: 3
off_threshold: 0
load:
colour: '#5fb6ad'
show_daily: true
Expand All @@ -262,6 +264,8 @@ Full Configuration (All Options)
load2_icon: mdi:pool
auto_scale: true
dynamic_colour: true
path_theshold: 100
off_threshold: 0
grid:
colour: '#5490c2'
export_colour: brown
Expand All @@ -281,6 +285,7 @@ Full Configuration (All Options)
animation_speed: 8
max_power: 8000
auto_scale: true
off_threshold: 0
entities:
use_timer_248: switch.sunsynk_toggle_system_timer
priority_load_243: switch.sunsynk_toggle_priority_load
Expand Down
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.40.1",
"version": "4.40.2",
"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
3 changes: 3 additions & 0 deletions src/cards/compact-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str
display="${!data.inverterProg.show && config.battery?.shutdown_soc_offgrid ? '' : 'none'}">
${data.shutdownOffGrid}%
</text>
<text x="5" y="294" class="st3 st8 left-align" fill="${data.gridColour}"
display="${!config.show_grid ? 'none' : ''}">${config.grid.grid_name}
</text>
<circle id="standby" cx="220" cy="260" r="3.5" fill="${data.inverterStateColour}"/>
<circle id="bat" cx="${data.compactMode ? '238.5' : '162'}"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export class SunsynkPowerFlowCard extends LitElement {
case totalGridPower < 0:
gridColour = gridExportColour;
break;
case totalGridPower === 0: //>= 0 && totalGridPower <= Utils.toNum(config.grid?.off_threshold, 0):
case totalGridPower >= 0 && totalGridPower <= Utils.toNum(config.grid?.off_threshold, 0):
gridColour = noGridColour;
break;
default:
Expand Down

0 comments on commit e2ac158

Please sign in to comment.