amaximus / garbage-collection-card

Custom Lovelace card for Garbage Collection custom component
MIT License
128 stars 24 forks source link

Hide_before config option is not observed #52

Closed realroywalker closed 3 years ago

realroywalker commented 3 years ago

I'm trying to make use of this card on my lovelace dashboard, and it seems to work great for the most part, but I can't get it to observe the 'Hide_before' setting. I've got two cards, both with 'hide_before' set to 7 each card looks at a different sensor - one has an expected date of 3 days, and another 10, yet both cards are visible.

I use this https://github.com/mampfes/hacs_waste_collection_schedule for the sources, which could be the issue - here is how the data shows in HA

image

amaximus commented 3 years ago

Please note that the garbage-collection-card was written to display information from Garbage Collection custom component [1]. This also means that the card expects state and attributes as provided by Garbage Coollection custom component [2]. In your case your sensor is missing the days attribute. Please see an example attached.

[1] https://github.com/bruxy70/Garbage-Collection/ [2] https://github.com/bruxy70/Garbage-Collection/#state-and-attributes

garbage

realroywalker commented 3 years ago

Thanks for the quick response - I'm using the other component since I take my dates from ICS file. I'll make use of your example image to see if I can format the attributes correctly so that they are detected by the card 👍

amaximus commented 3 years ago

Please also note that the acknowledge functionality (clicking the card when collection is due today or tomorrow hides the card) will not work if the last_collection attribute is missing.