pacemaker82 / PredBat-Table-Card

A custom Predbat table card that allows flexible column management and styling
7 stars 1 forks source link

Can’t get conditional card to work #17

Closed Boffinboy closed 2 months ago

Boffinboy commented 2 months ago

Hiya, loving the card! I am trying to use the conditional version but for some reason when I have it horizontal the card either doesn’t change, or doesn’t show. Any idea what might be going wrong? I copied the YAML directly and created a custom card.

gcoan commented 2 months ago

I've found the bug

In the conditional code, in landscape mode, car-column is displayed.

BUT if you don't have an EV (I don't) and have num_cars set to zero in predbat's apps.yaml then the car column isn't shown in the Predbat HTML plan.

The table card can't cope with this and displays a blank output.

Short term fix is either to get an EV, set num_cars to 1 for Predbat, or delete car-column out of the predbat table card config...

Boffinboy commented 2 months ago

Thanks, that was the fix I needed!

pacemaker82 commented 2 months ago

so to confirm, because the readme has car-column in the example, if you dont have an EV setup then this causes an issue with the display? I thought I had a check for that, but will have to re-test

gcoan commented 2 months ago

so to confirm, because the readme has car-column in the example, if you dont have an EV setup then this causes an issue with the display? I thought I had a check for that, but will have to re-test

Correct

I don't have an EV. The wider screen conditional output is blank if car column is defined in the output but not in the predbat html

pacemaker82 commented 2 months ago

@gcoan thanks - and this is only in the case where conditional card is used? I would have thought it would affect the card regardless...

pacemaker82 commented 2 months ago

Pushed a potential fix for this issue in 1.5.1.8. It will still render the car-column even if empty, but at least doesnt break the entire table. This should also make it more obvious that the card config needs tweaking. I tested/validated with iboost-column as will be same issue.

gcoan commented 2 months ago

Pushed a potential fix for this issue in 1.5.1.8. It will still render the car-column even if empty, but at least doesnt break the entire table. This should also make it more obvious that the card config needs tweaking. I tested/validated with iboost-column as will be same issue.

That works fine for car-column now, empty column now displaying