I cannot find the rest of the code for the media-player button. Can you share?
Found all now but how to setup card correct, mine does not look like your picture
Itās not because of the brackets, itās the logic behind.
With this version, there are three if-statements, and the last one overwrites the previous two. if (entity.state == 'hjemme') return 'š ';
This one checks, if the state is āhjemmeā. If it is, the icon will be set.
The next line does the same, but independent from the first.
The third line is another if-statement, that answers the question, is the state āferieā, if not, show the burnng icon. It is run totally indepent of the statements before. So every state, that is not āferieā shows the burning icon, no matter the two statements before.
To sum it up, the first two if-statements are totally ignored, the only one that is shown in the end is the third one, and that checks only, if the state is āferieā. Nothing else.
I hope this is understandably explained, if not, please ask again.
EDIT: This is exactly, why I use the curly brackets. Short hand code writing is easy, but it hides the logic a little bit. With the brackets it is easy to see, that the three statements donāt belong together and therefor donāt work together.
The āreturnā leaves the actual function and therefor the next statements arenāt run. insert-the-head-banging-smilie-here Sorry for the confusion, seems Iām not awake enoughā¦ Iāll go and repair my car now, before I post other nonsenseā¦ Sorry, really!
You are defining a button card and passing a list of cards to it.
So I think this wont work no matter what ā¦
Thatās also why youāre seeing one big white card
But I dont actually know how to fix it
Try and follow the configuration options from button-card: here
Depending on what you have, you can use templates for that as well. Templates from button-card (thatās what this is basically about) can be inherited from other templates. So what you need in the end, is a template like my_chips that inherit from the default chips.
Like this:
first_page_chips ā inherits from my_chips ā inherits from chips.
Iām guessing you took the idea from this comment from @paddy0174?
Thatās what Iām referring to
Thats correct, yes my inherits as I think of it is just from the standard button_card_templates.yaml file. So nothing fancy there. Maybe Paddy0174 have some tips, hint hint paddy;)