wow that was long ago…
because of helping Laineg above, I was reminded I also had those icons changing, and checked the mods in the thread. I can not for the life of me create a correct mod on the button entities them selves or in the footer section as is described there.
all I can do is set this global mod for the entities card containing the footer buttons:
- type: entities
card_mod:
class: class-header-margin
style:
hui-buttons-header-footer $ hui-buttons-base $ .ha-scrollbar:
ha-assist-chip:
.: |
ha-assist-chip:nth-child(2) {
--card-mod-icon: mdi:{{'stop' if is_state('script.play_tune','on')
else 'play'}}
when the footer config is:
footer:
type: buttons
entities:
- entity: input_boolean.loop_tune
name: Loop tune
- entity: script.play_tune
name: Speel tune
I did try this too but they fluke so I commented them so I wont forget…
footer:
type: buttons
# card_mod:
# style:
# hui-buttons-base $: |
# ha-assist-chip:nth-child(2) {
# {% if is_state('script.play_sound_bite','on') %}
# --card-mod-icon: mdi:stop;
# {% else %}
# --card-mod-icon: mdi:play;
# {% endif %}
entities:
- entity: input_boolean.loop_sound_bite
name: Loop soundbite
- entity: script.play_sound_bite
name: Speel soundbite
# card_mod:
# style: |
# :host {
# --card-mod-icon:
# {% if states('script.play_sound_bite') == 'on' %} mdi:stop
# {% else %} mdi:play
# {% endif %};
if you see an obvious error that might fix it, please dont hold back
btw, this IS a nice option to use the iif syntax:
.: |
ha-assist-chip:nth-child(2) {
--card-mod-icon:
mdi:{{iif(states('script.play_tune') == 'on','stop','play')}}
}