Possibility to include elements in addition to cards?
See original GitHub issueIs your feature request related to a problem? Please describe. I’ve been struggling with the following scenario:
I’m working on my floor plan, where I’m wrapping a Picture Elements card inside your config template card. This far, everything works great.
But, somewhere down the tree of image elements inside the picture elements card, I’m using the decluttering card, to be able to reuse the same config for a bunch of lights for example. This decluttering card has it’s config in another file, and the decluttering card has the ability to add an image element to it.
The problem I’m facing is that I’m trying to do quite a large portion of logic with the help of your card, but since the decluttering part is in another file, it seems I’ve lost the scope of the config template card.
Describe the solution you’d like In a dream scenario, I would in the separate decluttering card file be able to have the following structure (edit: have tried getting the correct line breaks to work without luck, but I hope you see what I’m after. Linebreak/indendation after every colon):
decluttering-card: card: custom:config-template-card element: type: image
…but since I can’t add an image element to your card, this can’t be done it seems. I think this would be a good additon to your card and make it easier for people to maintain structured and maintainable code with much flexibility.
Describe alternatives you’ve considered I’ve thought about moving the javascript logic to the “main” card and inject the result as variables into the decluttering card, but that would mean I’d have to rewrite the same logic for every decluttering card and it will be quite a few (since I haven’t found a way to create a global function or something in your card to be able to reuse the same logic across all decluttering card instances). This doesn’t seem efficient
I’ve tried using Yaml/Jinja inside the decluttering card, but I’m much more used to javascript and I’ve spent two days not being able to extract different values needed. Probably due to some linebreak/whitespace/indentation or something similar that YAML likes to complain about. Problem is, I’m not getting any console errors whatsoever, so this option I’d like to throw in the bin for now.
Additional context I’ve tried being as clear as I can, but please let me know if I can provide any more information or clear things up for you!
I really like using your card and it has saved me a lot of hair I would otherwise have pulled out by now.
// Jens.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
Yeah I think it will be pretty straight forward. Thanks for the PR
Pull request created:
#50