Skip to content

Commit

Permalink
Update sunsynk-power-flow-card.js
Browse files Browse the repository at this point in the history
Update Autarky calculation
  • Loading branch information
slipx06 authored Jun 19, 2023
1 parent 217738f commit e1d88d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dist/sunsynk-power-flow-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ class SunsynkPowerFlowCard extends LitElement {
}

const production_e = parseFloat(stateObj4.state) + parseFloat(stateObj.state);
const consumption_e = parseFloat(stateObj2.state);
const consumption_e = parseFloat(stateObj2.state) + parseFloat(stateObj1.state);
let Autarky = consumption_e != 0 ? Math.min(Math.round((production_e * 100) / Math.abs(consumption_e)), 100) : 0;
let Ratio = production_e != 0 ? Math.min(Math.round((Math.abs(consumption_e) * 100) / production_e), 100) : 0;

Expand Down

0 comments on commit e1d88d1

Please sign in to comment.