Closed luixal closed 10 months ago
Hello there! Thanks for posting this issue and thanks for your analysis!
I actually thought at first that i had fixed it :v But obviously that's not the case.
Since my last contribution on this project, i learned a lot about how useContext affects React performance causing re-renders and i am pretty sure that's the culprit, together with some other minor errors like comparison of objects (i am used to Python's behavior, which is far different from JavaScript's behavior).
I'll do a huge refactor on tailwindcss-template-card today, putting together everything that i learned in the recent months. I'll keep you posted about it!
Hello! Can you try v3.1.1 and check if the constant refreshes still happen?
For me, it seems that it works just fine now, not refreshing on every state change
Hi,
I just tried it out and it seems to be fixed, thanks! :)
Just for you to know, I realized it was constantly refreshing when I add some css to change card's background using card mod like this:
style: |
ha-card {
background-color: red;
}
Using that, you could see the red background constantly flickering. Also, this card in a 24/7 wallpanel made the system really clonky after a couple days due to memory issues. That's why I started looking into your code to see what could be going on :)
Anyway, now, it's working great.
Hi,
As other user has noticed in the community page thread, this card seems to be continously resfreshing.
I think the problem can be here, as this comparison will always evaluate to
false
ifattributes
is an object (which I think it is):I'm also not sure about this other comparison, as I think the
hass
object always contains all entities whenever one of them changes:I've trying this card and is awesome, but this continous refresh is causing performance issues in my wall panels which are always showing the dashboard. Would be nice to have it fixed :)
Maybe it would be simpler watching only entities in the
entity
andentities
fields, not looking into thecontent
to find them.Thanks for your great work!
PS: if you add some steps about how to compiling and testing this card I can give it a try :)