Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table does not automatically update after entity deletion #104

Closed
daringer opened this issue Sep 3, 2023 · 6 comments
Closed

table does not automatically update after entity deletion #104

daringer opened this issue Sep 3, 2023 · 6 comments

Comments

@daringer
Copy link
Collaborator

daringer commented Sep 3, 2023

#103 dramatically helps reducing table updates, nevertheless deleting one entity (click a row in table, choose settings, choose delete) does not reload the table. @EdLeckert we might need to improve the no-update-condition to catch this, ideas?

Generally this is more or less the case that last_updated will stay the same, but the (matched) entities change...

@daringer daringer changed the title table does not automatically update on entity deletion table does not automatically update after entity deletion Sep 3, 2023
@ildar170975
Copy link
Contributor

nevertheless deleting one entity (click a row in table, choose settings, choose delete)

Could you elaborate?
How can we "click a row in table, choose settings, choose delete"?

@EdLeckert
Copy link
Contributor

Clicking a row brings up the more-info dialog. Click the gear icon, scroll down to the bottom left, click DELETE. The entity is deleted, but the table does not update.

Already fixed in next PR:

Feel free to test it if you like.

@EdLeckert
Copy link
Contributor

Fixed by:

Check for change of row count before checking max of last_updated.

@daringer daringer closed this as completed Sep 4, 2023
@ildar170975
Copy link
Contributor

ildar170975 commented Sep 4, 2023

So, this is about entities made in UI.
Assume we have an entity with an attribute which is a list (each element may be a value or a dictionary).
Then the card will be filled with this list's (array) elements.
Example - a weather entity may have a forecast attribute.
Clicking on any row shows "more-info" for the same entity.

Currently entities which may be created in UI do NOT have list attributes.
But imagine that some forthcoming HA release will allow to create template sensors - and we may create a list attribute there (my guess, cannot check).
And these template sensors - as created in UI - could be deleted in UI too.
So, if this sensor with a list attribute is shown in flex-grid-card - after deletion this sensor all rows should be deleted.

Will it be possible with this PR?
Can a table be empty?

P.S. Now with 0.7.3 the table can be empty:
изображение

@EdLeckert
Copy link
Contributor

@ildar170975:

The situation you describe is exactly what I have done with my wine database integration. A single entity represents the wine inventory, and a single attribute of that entity holds a list of dictionary items, one for each bottle.

Clicking any row brings up the same more-info dialog, as you know. And deleting the entity from that dialog would wipe out the entire inventory, leaving an empty table. So, not particularly useful in this case.

Does that answer your questions?

@ildar170975
Copy link
Contributor

ildar170975 commented Sep 4, 2023

@EdLeckert
Yes!
Let's say this is a kind of "synthetic" case - but I am glad that you tested it as well!
Thanks a lot for your efforts.

A single entity represents the wine inventory

Now here is a really useful application for the HA )))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants