@@ -35,7 +35,6 @@ class PredbatTableCard extends HTMLElement {
3535 if ( oldEntityUpdateTime !== newEntityUpdateTime )
3636 this . processAndRender ( hass ) ;
3737 }
38-
3938
4039 }
4140
@@ -309,9 +308,12 @@ class PredbatTableCard extends HTMLElement {
309308 newCell . style . minWidth = "110px" ;
310309 }
311310
312- if ( this . config . use_friendly_states === true ) {
311+ if ( this . config . use_friendly_states === true && this . isSmallScreen ( ) === false ) {
313312 chargeString = "Planned Charge" ;
314313 dischargeString = "Planned Discharge" ;
314+ } else if ( this . config . use_friendly_states === true && this . isSmallScreen ( ) === true ) {
315+ chargeString = "Plnd Chg" ;
316+ dischargeString = "Plnd Dis" ;
315317 }
316318
317319 newCell . innerHTML = `<div style="width: 100%; height: 100%;">
@@ -346,8 +348,6 @@ class PredbatTableCard extends HTMLElement {
346348 }
347349 } else {
348350
349-
350-
351351 let friendlyText = "" ;
352352 if ( column === "state-column" ) {
353353
@@ -378,6 +378,8 @@ class PredbatTableCard extends HTMLElement {
378378 newContent = friendlyText ;
379379 }
380380 }
381+
382+
381383
382384 newCell . style . backgroundColor = theItem . color ;
383385 if ( theItem . value . replace ( / \s / g, '' ) . length === 0 ) {
@@ -388,6 +390,9 @@ class PredbatTableCard extends HTMLElement {
388390 newContent = newContent . replace ( ' ' , '' ) ;
389391 newContent = newContent . trim ( ) ;
390392 }
393+ if ( column === "total-column" )
394+ newContent = this . adjustTotalCostField ( newContent ) ;
395+
391396 newCell . innerHTML = `<div class="iconContainer" title="${ friendlyText } "><div style="margin: 0 2px;">${ newContent } </div>${ additionalArrow } </div>` ;
392397 }
393398 }
@@ -444,7 +449,11 @@ class PredbatTableCard extends HTMLElement {
444449 newCell . style . color = theItem . color ;
445450 newCell . style . textShadow = "none" ;
446451
447- newCell . innerHTML = `<div class="iconContainer">${ theItem . value } </div>` ;
452+ let content = theItem . value ;
453+ if ( column === "total-column" )
454+ content = this . adjustTotalCostField ( content ) ;
455+
456+ newCell . innerHTML = `<div class="iconContainer">${ content } </div>` ;
448457
449458 } else if ( column === "soc-column" || column === "cost-column" ) {
450459
@@ -620,6 +629,14 @@ class PredbatTableCard extends HTMLElement {
620629 return newCell ;
621630 }
622631
632+ adjustTotalCostField ( cost ) {
633+ if ( cost . includes ( "-" ) ) {
634+ cost = cost . replace ( "-" , "" ) ;
635+ cost = "-" + cost ;
636+ }
637+ return cost ;
638+ }
639+
623640 getPricesFromPriceString ( thePriceString , hasBoldTags , hasItalicTags , debugOnly ) {
624641
625642// ? ⅆ - Rate that has been modified based on input_number.predbat_metric_future_rate_offset_import or input_number.predbat_metric_future_rate_offset_export
0 commit comments