Skip to content

Commit

Permalink
Fixed bug solar to battery line not showing
Browse files Browse the repository at this point in the history
`grid.state.toBattery` was equal to `battery.state.toBattery` when `solar.state.toHome` was positive, so it was assuming all charge comming from grid and not from solar.
  • Loading branch information
shycats authored Oct 15, 2023
1 parent 15d6dd2 commit 4e560fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/power-flow-card-plus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,8 @@ export class PowerFlowCardPlus extends LitElement {
}
}
solar.state.toHome = 0;
} else if (battery.state.toBattery && battery.state.toBattery > 0) {
grid.state.toBattery = battery.state.toBattery;
} else {
grid.state.toBattery = 0;
}
grid.state.toBattery = (grid.state.toBattery ?? 0) > largestGridBatteryTolerance ? grid.state.toBattery : 0;

Expand Down

0 comments on commit 4e560fb

Please sign in to comment.