iantrich / config-template-card

📝 Templatable Lovelace Configurations
MIT License
441 stars 56 forks source link

Fr entities list #4

Closed randellhodges closed 5 years ago

randellhodges commented 5 years ago

This might slightly change the behavior.

With entity defined on the same level as config it will work with lists of things and with monster-card. In addition, eval was removed in favor of new Function that provides a fixed variable inside the script named thisEntity, which will allow us to use it in monster-card and maybe other places.

I have not extensively tested the changes.

iantrich commented 5 years ago

Thanks, I'll give this a good look over tonight :)

randellhodges commented 5 years ago

When reviewing, please double check the part where I mentioned the entity parameter shifting. I am not certain if that will break some functionality you had in mind or not.

iantrich commented 5 years ago

Not sure this is the route I want to go. It's not always an entity that dictates a configuration or template. There are plenty of elements that don't even require an entity be defined. Going to release something tonight that should handle lists though and would love help with examples/testing and make sure I'm not missing anything further. Thanks!

randellhodges commented 5 years ago

Yeah, that is why I called out a few times the entity thing. I wasn't entirely sure of your vision. I will probably spin this out for myself however because I really wanted something like this but never thought of implementing it. Making it work with monster-card was one of the biggest things I needed.