mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 00:36:34 +00:00
Fix return compensation not being negative (#9654)
This commit is contained in:
parent
5147dff670
commit
2982adbfa7
@ -202,7 +202,7 @@ export class HuiEnergySourcesTableCard
|
|||||||
flow.stat_cost ||
|
flow.stat_cost ||
|
||||||
this._energyInfo!.cost_sensors[flow.stat_energy_from];
|
this._energyInfo!.cost_sensors[flow.stat_energy_from];
|
||||||
const cost = cost_stat
|
const cost = cost_stat
|
||||||
? calculateStatisticSumGrowth(this._stats![cost_stat])
|
? calculateStatisticSumGrowth(this._stats![cost_stat]) || 0
|
||||||
: null;
|
: null;
|
||||||
if (cost !== null) {
|
if (cost !== null) {
|
||||||
totalCost += cost;
|
totalCost += cost;
|
||||||
@ -260,7 +260,8 @@ export class HuiEnergySourcesTableCard
|
|||||||
flow.stat_compensation ||
|
flow.stat_compensation ||
|
||||||
this._energyInfo!.cost_sensors[flow.stat_energy_to];
|
this._energyInfo!.cost_sensors[flow.stat_energy_to];
|
||||||
const cost = cost_stat
|
const cost = cost_stat
|
||||||
? calculateStatisticSumGrowth(this._stats![cost_stat])
|
? (calculateStatisticSumGrowth(this._stats![cost_stat]) ||
|
||||||
|
0) * -1
|
||||||
: null;
|
: null;
|
||||||
if (cost !== null) {
|
if (cost !== null) {
|
||||||
totalCost += cost;
|
totalCost += cost;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user