Skip to content

Commit

Permalink
fix: logic when using custom grid icons
Browse files Browse the repository at this point in the history
  • Loading branch information
slipx06 committed Jan 11, 2025
1 parent 41539b2 commit 3dc3a1a
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.2.1",
"version": "6.2.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
4 changes: 2 additions & 2 deletions src/cards/compact-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str
${config.grid?.navigate
? svg`
<a href="#" @click=${(e) => Utils.handleNavigation(e, config.grid.navigate)}>
<g display="${config.show_grid || config.grid.import_icon || config.grid.disconnected_icon || config.grid.export_icon ? '' : 'none'}">
<g display="${config.show_grid && (config.grid.import_icon || config.grid.disconnected_icon || config.grid.export_icon) ? '' : 'none'}">
<foreignObject x="-0.5" y="187.5" width="70" height="70">
<div xmlns="http://www.w3.org/1999/xhtml" style="position: fixed; width: 70px; height: 70px;">
<ha-icon icon="${data.customGridIcon}" class="grid-icon"></ha-icon>
Expand All @@ -1429,7 +1429,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str
</a>`
: svg`
<a href="#" @click=${(e) => Utils.handlePopup(e, config.entities.grid_connected_status_194)}>
<g display="${config.show_grid || config.grid.import_icon || config.grid.disconnected_icon || config.grid.export_icon ? '' : 'none'}">
<g display="${config.show_grid && (config.grid.import_icon || config.grid.disconnected_icon || config.grid.export_icon) ? '' : 'none'}">
<foreignObject x="-0.5" y="187.5" width="70" height="70">
<div xmlns="http://www.w3.org/1999/xhtml" style="position: fixed; width: 70px; height: 70px;">
<ha-icon icon="${data.customGridIcon}" class="grid-icon"></ha-icon>
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 @@ -1361,7 +1361,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string
${config.grid?.navigate
? svg`
<a href="#" @click=${(e) => Utils.handleNavigation(e, config.grid.navigate)}>
<g display="${config.show_grid || config.grid.import_icon || config.grid.disconnected_icon || config.grid.export_icon ? '' : 'none'}">
<g display="${config.show_grid && (config.grid.import_icon || config.grid.disconnected_icon || config.grid.export_icon) ? '' : 'none'}">
<foreignObject x="${config.inverter.three_phase ? '404' : '389'}"
y="${config.inverter.three_phase ? '339' : '308'}"
width="${config.inverter.three_phase ? '34' : '65'}"
Expand All @@ -1375,7 +1375,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string
</a>`
: svg`
<a href="#" @click=${(e) => Utils.handlePopup(e, config.entities.grid_connected_status_194)}>
<g display="${config.show_grid || config.grid.import_icon || config.grid.disconnected_icon || config.grid.export_icon ? '' : 'none'}">
<g display="${config.show_grid && (config.grid.import_icon || config.grid.disconnected_icon || config.grid.export_icon) ? '' : 'none'}">
<foreignObject x="${config.inverter.three_phase ? '404' : '389'}"
y="${config.inverter.three_phase ? '339' : '308'}"
width="${config.inverter.three_phase ? '34' : '65'}"
Expand Down

0 comments on commit 3dc3a1a

Please sign in to comment.