kalkih / mini-media-player

Minimalistic media card for Home Assistant Lovelace UI
MIT License
1.52k stars 207 forks source link

Crossfade toggle button #711

Open macbih opened 1 year ago

macbih commented 1 year ago

Some systems like Sonos do provide a switch for crossfading, e.g. switch.<sonos_speaker>_crossfade. While it is possible to "misuse" a media shortcut button like this

shortcuts:
  buttons:
    - name: Crossfade
      type: service
      id: switch.toggle
      data:
        entity_id: switch.<sonos_speaker>_crossfade

the resulting button does not show the actual state of the switch. So I propose an additional UI button for this functionality which shall work just like buttons such as shuffle and repeat. As there may be no automatic connection to a crossfade switch, it may make sense to add a definition like this:

crossfade:
  entity_id: switch.<sonos_speaker>_crossfade

The button would be automatically shown so that there is no additional hide declaration necessary.

What do you think?