Skip to content

Commit 13a7aeb

Browse files
authored
Update predbat-table-card.js
Switched net-power-column from negative to positive
1 parent 7f4b310 commit 13a7aeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

predbat-table-card.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,9 +1268,9 @@ class PredbatTableCard extends HTMLElement {
12681268
let pvValue = newTRObject[headerClassesArray[5]].value.replace(/[]/g, '');
12691269
if(pvValue.length === 0)
12701270
pvValue = 0;
1271-
const netPower = (parseFloat(newTRObject[headerClassesArray[6]].value) - parseFloat(pvValue)).toFixed(2);
1271+
const netPower = (parseFloat(pvValue) - parseFloat(newTRObject[headerClassesArray[6]].value)).toFixed(2);
12721272
let adjustedColor;
1273-
if(netPower < 0){
1273+
if(netPower > 0){
12741274
if(this.getLightMode(hassDarkMode) === false && this.config.old_skool !== true){
12751275
adjustedColor = this.getDarkenHexColor("#3AEE85", 30);
12761276
} else {

0 commit comments

Comments
 (0)