using a conditional set of custom button-cards, I am left with the challenge to set a max size to the (variable number of) buttons while also retaining aspect_ratio: 1/1
Now I ‘know’ a situation where all 4 cards would be alive together will never happen, so Ive aded a custom blank-card in there, otherwise a single alert card would even be bigger.
I’d love the cards to have a max setting as if 4 cards in the horizontal-stack would be alive.
Can this be achieved?
as an example the Alert setup as it is now, with 1 alert going on, together with the card below, with the desired 4 button size for comparison:
I think you’ll have to have a conditional based on the number of cards that will appear in that area and then make each possibility with only the number of cards that will be displayed.
yeah, I fear I have to come up with something manual like that… not too simple though.
Didn’t @RomRider mention he was considering something with a grid in one of the threads? this would be a nice trick, a conditional grid of sorts based on entities states…
can that be done @thomasloven?, based on a sensor counting the number of alerts to be displayed (in my use-case here). assume a grid of 4 buttons (button-card), condition binary alert is on, show:
count alert 1: show button 1 of 4
count alert 2: show button 2 of 4
etc
etc
and most importantly, show these buttons left to right, no matter which alert is on…
but, just downloaded state-switch. Should at least make my home-view nicer (based on the alert-counter state)
after that, hope to do something with the layout-card. didn’t see yet though if we can template that somehow…
since the order of the alert buttons is now ‘fixed’, there seems to be a very small horizontal gap if the card are no displayed, and lets say the updater card only (like now) is shown.