Closed Chris-V closed 4 years ago
I also was running into problems with picture-elements cards, but I'm the opposite of you. My frame is the same in my cards, but the number of elements change. For example, one might have 3 sensors while the other has 2 of 3. It'd be cool if some variables could be "optional", and if they aren't filled in would just be as if the element was blank. It might be a work around for your situation, but you'd just have yours more like this:
decluttering_templates:
demo:
card:
type: picture-elements
image: /local/frontend/demo_bg.jpg
elements:
- type: icon
icon: mdi:alert-circle
title: Problem detected!
entity: '[[entity1]]'
tap_action:
action: more-info
style:
right: -1%
top: 7%
color: var(--google-red-500)
filter: drop-shadow(black 0 0 1px)
- type: icon
icon: mdi:alert-circle
title: More Problem detected!
entity: '[[entity2]]'
tap_action:
action: more-info
style:
right: -1%
top: 17%
color: var(--google-red-500)
filter: drop-shadow(black 0 0 1px)
views:
- title: Home
path: home
icon: mdi:home
cards:
- type: 'custom:decluttering-card'
template: demo
variables:
- entity1: sensor.something
- type: 'custom:decluttering-card'
template: demo
variables:
- entity2: sensor.somethingWorse
- type: 'custom:decluttering-card'
template: demo
variables:
- entity1: sensor.something
- entity2: sensor.somethingWorse
And there you'd have 3 picture elements cards, two with just the single guy, and the third has both at the same time.
Looks like it works with picture elements, but should I open up a new issue for having "optional" variables?
I don't see how I can make this happen sorry :(
Ok, no problem!
:tada: This issue has been resolved in version 1.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Hi. First of all, this card is amazing. It allowed me to shrink my UI config by a lot. It's way easier to maintain by a huge margin.
The only thing I haven't been able to do is declutter my picture-elements cards. I have a couple of them that contain similar elements, but the "frame itself" (the picture-elements card) is too different so I can't just go and move the whole card to a template.
Doing something like so would actually be amazing:
Thanks again for the awesome work!