Skip to content

Commit

Permalink
Merge pull request #46 from molikk/hide-load-frame-when-power-entity-…
Browse files Browse the repository at this point in the history
…is-not-present

hide load frame when power entity is not present
  • Loading branch information
molikk authored Jul 28, 2024
2 parents 796ec48 + 78e3064 commit 4521a12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/mlk-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": "mlk-power-flow-card",
"version": "0.10.1",
"version": "0.10.2",
"description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.",
"main": "mlk-power-flow-card.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/cards/compact/loadUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export class LoadUtils {
return svg`
${icon}
<rect id=${type}_load_frame-${id}" x="${shapeX}" y="${shapeY}" width="41" height="20"
rx="4.5" ry="4.5" fill="none" stroke="${color}" pointer-events="all" />
rx="4.5" ry="4.5" fill="none" stroke="${color}" pointer-events="all"
display="${power.isValid() || toggle.isValidSwitch() ? '' : 'none'}" />
<text id="${type}_load_name-${id}" x="${nameX}" y="${nameY}" class="st3 st8" fill="${color}">
${name ? `${name}` : ''}
</text>
Expand All @@ -78,7 +79,7 @@ export class LoadUtils {
}
<a href="#" @click=${(e) => Utils.handlePopup(e, energy.entity_id)}>
<text id="${type}_load_extra-${id}" x="${energyX}" y="${energyY}"
display="${energy.entity_id && energy.isValid() ? '' : 'none'}"
display="${energy.isValid() ? '' : 'none'}"
class="st3" fill="${color}">
${energy.toNum(1)}
${energy.getUOM()}
Expand Down

0 comments on commit 4521a12

Please sign in to comment.