Skip to content

Commit

Permalink
fix: 🚑 hotfix wrong power calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
flixlix committed Jul 10, 2023
1 parent 4948b58 commit 8240d5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "power-flow-card-plus",
"version": "0.1.6",
"version": "0.1.6.2",
"description": "A power flow card for Home Assistant",
"keywords": [
"home-assistant",
Expand Down
4 changes: 2 additions & 2 deletions src/power-flow-card-plus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ export class PowerFlowCardPlus extends LitElement {
}

if (solar.state.toHome !== null && solar.state.toHome < 0) {
solar.state.toHome = 0;
// What we returned to the grid and what went in to the battery is more
// than produced, so we have used grid energy to fill the battery or
// returned battery energy to the grid
Expand All @@ -565,7 +564,8 @@ export class PowerFlowCardPlus extends LitElement {
grid.state.toBattery = grid.state.fromGrid;
}
}
} else if (battery.state.toBattery && battery.state.toBattery > 0) {
solar.state.toHome = 0;
} else if (!solar.has && battery.state.toBattery && battery.state.toBattery > 0) {
grid.state.toBattery = battery.state.toBattery;
}

Expand Down
2 changes: 2 additions & 0 deletions src/ui-editor/schema/_schema-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const cardConfigStruct = assign(
theme: optional(string()),
dashboard_link: optional(string()),
dashboard_link_label: optional(string()),
second_dashboard_link: optional(string()),
second_dashboard_link_label: optional(string()),
inverted_entities: optional(any()),
w_decimals: optional(integer()),
kw_decimals: optional(integer()),
Expand Down

0 comments on commit 8240d5e

Please sign in to comment.