Skip to content

Commit a076ede

Browse files
authored
Update predbat-table-card.js
Adding support for "-" in the Clip kWh column
1 parent 68d0e28 commit a076ede

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

predbat-table-card.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ class PredbatTableCard extends HTMLElement {
498498

499499

500500
newCell.style.backgroundColor = theItem.color;
501-
if(theItem.value.replace(/\s/g, '').length === 0) {
501+
if(theItem.value.replace(/\s/g, '').length === 0 || theItem.value === "0") {
502+
502503
if(fillEmptyCells)
503504
newCell.innerHTML = `<div class="iconContainer"><ha-icon icon="mdi:minus" style="margin: 0 2px; opacity: 0.25;"></ha-icon></div>`;
504505
} else {
@@ -531,7 +532,7 @@ class PredbatTableCard extends HTMLElement {
531532

532533
if(column !== "import-export-column"){
533534
newCell.style.color = theItem.color;
534-
if(theItem.value.replace(/\s/g, '').length === 0) {
535+
if(theItem.value.replace(/\s/g, '').length === 0 || theItem.value === "0") {
535536
if(fillEmptyCells)
536537
newCell.innerHTML = `<div class="iconContainer"><ha-icon icon="mdi:minus" style="margin: 0 2px; opacity: 0.25;"></ha-icon></div>`;
537538
} else

0 commit comments

Comments
 (0)