Skip to content

Commit

Permalink
fix: prevent negative solar state
Browse files Browse the repository at this point in the history
closes #23
  • Loading branch information
ulic75 committed May 10, 2022
1 parent 24f2999 commit a2f27e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/power-flow-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class PowerFlowCard extends LitElement {
const batteryChargeState = entities.battery_charge?.length
? this.getEntityState(entities.battery_charge)
: null;
const solarState = this.getEntityStateWatts(entities.solar);
const solarState = Math.max(this.getEntityStateWatts(entities.solar), 0);

const solarToGrid = hasReturnToGrid
? typeof entities.grid === "string"
Expand Down

0 comments on commit a2f27e3

Please sign in to comment.