mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +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 ||
|
||||
this._energyInfo!.cost_sensors[flow.stat_energy_from];
|
||||
const cost = cost_stat
|
||||
? calculateStatisticSumGrowth(this._stats![cost_stat])
|
||||
? calculateStatisticSumGrowth(this._stats![cost_stat]) || 0
|
||||
: null;
|
||||
if (cost !== null) {
|
||||
totalCost += cost;
|
||||
@ -260,7 +260,8 @@ export class HuiEnergySourcesTableCard
|
||||
flow.stat_compensation ||
|
||||
this._energyInfo!.cost_sensors[flow.stat_energy_to];
|
||||
const cost = cost_stat
|
||||
? calculateStatisticSumGrowth(this._stats![cost_stat])
|
||||
? (calculateStatisticSumGrowth(this._stats![cost_stat]) ||
|
||||
0) * -1
|
||||
: null;
|
||||
if (cost !== null) {
|
||||
totalCost += cost;
|
||||
|
Loading…
x
Reference in New Issue
Block a user