pacemaker82 / PredBat-Table-Card

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

hide_empty_columns: true is causing all cards in a view to disappear #30

Closed goldendel closed 3 months ago

goldendel commented 3 months ago

Hello,

This is the YAML for my card.

type: custom:predbat-table-card entity: predbat.plan_html columns:

If I set hide_empty_columns: true

All cards in the view disappear. If I am not doing something wrong, this appears to be a bug?

Thanks for your help,

Tim

goldendel commented 3 months ago

Hi @pacemaker82 I'm not sure if it helps but I've just identified that hide_empty_columns: only creates a blank screen when there is a blank column (iboost-column in my case). If I remove iboost-column and set hide_empty_columns: true it works fine.

pacemaker82 commented 3 months ago

Sorry for the slow response to getting round to this. It should be fixed in the 1.5.5.4 release

goldendel commented 3 months ago

No problem at all and thank you for writing a fix. It's fascinating for me to see the code you have changed and where it was previously failing. I've tested 1.5.5.4.

I can confirm the cards no longer disappear when iboost-column is present and hide_empty_columns: true. However, the iboost-column also does not disappear with no values present.

I think the logic check && item["iboost-column"].value.length > 0) on line 191 may be failing, but I don't know the right alternative to try for a blank/null item? I hope this helps and I'm really interested in how you debug/resolve this. It's a great learning exercise for me.

pacemaker82 commented 3 months ago

Hmmm let me check that again then. Can you confirm you are using the iboost config in predbat? Meaning its enabled? A screenshot of your original predbat card would be ace.

Last fix was just a typo ... lowercase b instead of B - was throwing an error that I missed.

pacemaker82 commented 3 months ago

i found the issue - it was another typo with B vs b - sorted now, will release today in 1.5.5.5

pacemaker82 commented 3 months ago

Should now be fixed and available in 1.5.5.5

goldendel commented 3 months ago

i found the issue - it was another typo with B vs b - sorted now, will release today in 1.5.5.5

Thanks @pacemaker82 Confirming commit 78de7c0 fixed it for me. I've now upgraded to 1.5.5.6.

Where did you see the errors that were thrown? Just interested for helping troubleshooting in future.

pacemaker82 commented 3 months ago

In the chrome web browser, you can use developer mode to see the console. Thats where errors appear

Glad it fixed it for you.

goldendel commented 2 months ago

Great. Thanks for fixing it and thanks for the advice!