Here is an interesting problem I have with my config.
My blind open/ closed button does not seem to obey the theme that has been applied to each button. You can see from the following two pictures that the on/ off - open/ closed states are completely different - the blind produces a black icon and black border where it should be yellow ?!?!
Is this because the button card is reading the states on/ off only and does not understand the open/ closed states?
Yes itās only on/off, you can use the state object to do what you want, see here
And you have lots of examples here in the forum also.
Thank you for the response and understood - the problem that āI think I haveā is that the inherited style from the master theme is being ignored - for example when I apply a box shadow color directly as below this works:
Just so that I understand correctly I have to match all values in the array and be explicit in the styles that are applied for this instance (open/ closed) for it to work correctly?
Yes, thatās the idea. You declare the states that you want to match (BTW, operator: '==' is the default, you donāt have to explicitly write it), and for each one you apply your specificities. It can be styles, or icons or specific labels, names, ā¦
You can also use the operator: default to match everything that didnāt match a state in the array, itās like an else.
The order in which you put the entries in the state object matters. The first one to match will be used (meaning if you put default at the beginning, nothing else after will match for example)
Iāve made a very simple button card using the icon_state_name2nd layout but am having some spacing/alignment issues. Iām sure its user error but canāt figure out what Iām doing wrong.
which as you can see has a lot of wasted space at the top and the icon is not aligned with the text. Iāve tried removing top padding, etc using styles but it seems like the card is holding that space for a state element (but of course Iām not displaying one; by default itās turned off and as you can see in my config I even tried forcing it off using show_state: false but the space wonāt go away) If I turn on show_state: true everything looks balanced, the state text āOffā appears and everything looks alignedā¦ but Iām not interested in displaying the state on the card.
How do I keep it off and properly align everything?
Ah, cheers for the quick reply. Iāve been able to get it mostly aligned by limiting the card height and forcing some craziness in the amount of padding used. Itās still slightly off balance but much better than pictured above.
If you think it might be a bug, is it useful for me to submit a bug report or is my post above sufficient?
Iām trying to do some slight altering of the code to test some stuff, are there any instructions on how to build this locally? Cant find any on github
That would be from the old version of this button card and unlikely to be code compatible unfortunately. Latest version can be found here: https://github.com/custom-cards/button-card
I tried looking through this entire thread, and still canāt figure out if thereās a way to change both icon and card color with state changesā¦ anyone successfully get it to work and could provide an example?
Iāve been using the simple-weather-card for awhile now, but have recently went all in with button-card. .So to replace that information I came up with my own Dark Sky button-card and wanted to share: Note: I havenāt tested all weather conditions, so there might be some bugs in the state section
I replaced my lovelace-flower-card with a button-card as well. I chose to not display light and temperature levels as those are not usually something I need at a glance, but more so at a historical/graphical level. I have those displayed in a custom popup-card using mini-graph-card