gadgetchnnel / lovelace-home-feed-card

A custom Lovelace card for displaying a combination of persistent notifications, calendar events, and entities in the style of a feed.
266 stars 22 forks source link

Wrong entity state history showing up #28

Closed septeven closed 4 years ago

septeven commented 4 years ago

Hi (again) I'm encountering a bug with your card.

I have embedded it in a popup that shows state history of an entity the popup is dedicated to. For example purpose, let's say I have two door/window sensors, one is for my office window, the other is for my garage door.

Hopefully, I'm clear and I hope that'll allow you to reproduce the issue, let me know if you need more details though.

Thank you again,

gadgetchnnel commented 4 years ago

I think this may be due to the way the card caches data using localStorage. It uses a key based on a combination of the current page url and the title property of the Home Feed card, so do you use the same title for card in both popups?

I may be able to add an option to override the cache id, but a workaround would be to use a different title for the card in each popup.

septeven commented 4 years ago

I see, I'm not using any title property actually as it won't fit my layout, that's probably why.

Maybe instead of using the title property, what do you think about adding a uid property to the card which will override - if set - the use of the title property in the combination for generating the localStorage key ? not sure if that could be a workaround for you ?

gadgetchnnel commented 4 years ago

Closing this as the latest version, 0.4.0, now includes a card_id option which will control the key it uses for caching in Local Storage.