Skip to content

docs: Examples for "templating entities"#163

Open
ildar170975 wants to merge 1 commit into
iantrich:devfrom
ildar170975:examples-templated-entities
Open

docs: Examples for "templating entities"#163
ildar170975 wants to merge 1 commit into
iantrich:devfrom
ildar170975:examples-templated-entities

Conversation

@ildar170975
Copy link
Copy Markdown
Collaborator

Added some examples for "templating entities".

@ildar170975 ildar170975 marked this pull request as ready for review March 8, 2025 13:03
@ildar170975
Copy link
Copy Markdown
Collaborator Author

@PaulSD please review

@ildar170975 ildar170975 changed the title docs: examples for "templating entities" docs: Examples for "templating entities" Mar 8, 2025
@Mariusthvdb
Copy link
Copy Markdown

seem a very interesting development tour introducing here.

the thing that always bugs my system is when config-template-card recalculates the complete card upon updating of the entities involved.

Tbh, I steer away from config-template-card even if it requires me to write a config multiple times and use a conditional to replace it. The later is always much lighter in the system.

So, re-iterating on my own request above, I fear that intoducing this functionality might make things even worse.
A bit like the constant update icon circling we see on apex-charts, and being really heavy on the frontend (and backend depending on the templates..)

iow, did you test to see what happens when implementing this seriously? Small documentation examples always work, but real life configs tend to be a different beast...

@ildar170975
Copy link
Copy Markdown
Collaborator Author

It depends on a particular user config.
The “old” implementation could kill a system too in case of , let’s say, “not optimal” user implementation. Take card-mod as an example and infinite complains on GitHub about “everything unstable, my system freezes etc”.
You may keep defining the “entities” with an “old way”, just as a simple list.
Consider these changes as “additional flexibility”. Of course we all should check if changes make the card less agile.
As for “card redraws itself on every update” - this is a different task which should be considered next.

@PaulSD
Copy link
Copy Markdown

PaulSD commented Mar 9, 2025

config-template-card recalculates the complete card upon updating of the entities involved

I feel like either you or I must be missing something here.
See #112 (comment) for details.

Basically, yes CTC does recalculate the whole card on every update, but that is the fundamental design of Lovelace (and the underlying Lit framework), it is true of all Lovelace cards, and it shouldn't have any measurable performance impact unless you have an extreme use case (like thousands of entities or templates that make slow AJAX calls).

What specific problems are you observing?

(Might be best to continue this discussion in #112 since it isn't really related to this documentation update.)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants