Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to hide shortcut buttons based on conditions? #864

Open
0xskynet opened this issue Nov 1, 2024 · 2 comments
Open

Possible to hide shortcut buttons based on conditions? #864

0xskynet opened this issue Nov 1, 2024 · 2 comments

Comments

@0xskynet
Copy link

0xskynet commented Nov 1, 2024

Trying to hide the buttons based on a state (eg. states.media_player.my_rest_2nd_gen_media_player.state == 'playing' ). Possible with mini media player ? I need to implement some custom sound upon starting so i can't use built in power button.

type: custom:mini-media-player
entity: media_player.my_rest_2nd_gen_media_player
group: false
volume_stateless: false
toggle_power: false
artwork: cover-fit
source: full
power_buttons:
  power:
    type: script
    id: script.rest_media_stop
shortcuts:
  buttons:
    - icon: mdi:stop
      type: script
      id: script.rest_media_stop
    - icon: mdi:play
      type: script
      id: script.rest_set_sound_mode
      data:
        sound_mode: WhiteNoise
@Scepticalist
Copy link

Card-Mod should allow you to do this?

@ColtonYYZ
Copy link

Yes:

    card_mod:
      style: |
        :host {
        {% if is_state("media_player.colton_s_echo_show", "off") %}
          --mush-icon-symbol-size: 0.0em;
        {% else %}
          --mush-icon-symbol-size: 1.0em;
        {% endif %}
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants