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

Media player icon state not set #144

Closed
ipodmusicman opened this issue Jul 13, 2019 · 3 comments
Closed

Media player icon state not set #144

ipodmusicman opened this issue Jul 13, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@ipodmusicman
Copy link

Hi there,

Just started using the mini player today and I don't know under which rock I had been hiding. :)

Just found some small issue. I noticed that the "cast" icon is turned off on the player whereby it is turned on when you click to open the "more info" dialog box. I also added the Nvidia Shield as a "non mini media player" to my entities card and the icon is turned "on".

See the image attached as well as the YAML code snippet below.

// this is using min media player. Note the icon on the top left is "off"

  • entity: media_player.lounge_nvidia_shield
    group: true
    hide:
    power: true
    volume: true
    type: 'custom:mini-media-player'
  • entity: media_player.yamaha_receiver
    group: true
    hide:
    controls: true
    source: true
    type: 'custom:mini-media-player'
    // this is not using mini media player. Note the icon on the top left is "on"
  • entity: media_player.lounge_nvidia_shield

I'm using the Nvidia Shield as an example, but the same happens with the Yamaha AVR.

image

@kalkih kalkih added the enhancement New feature or request label Jul 13, 2019
@kalkih
Copy link
Owner

kalkih commented Jul 13, 2019

Hello, thanks for the detailed explanation!

Yes, this is a feature that's not currently implemented in the card, but could be added eventually.
If you need this functionality right now you could try using config-template-card to make the icon change depending on state.

# note: untested code
type: 'custom:config-template-card'
variables:
  - states['media_player.lounge_nvidia_shield'].state
card:
  type: custom:mini-media-player
  icon: "${vars[0] === 'off' || vars[0] === 'unavailable' ? 'mdi:cast' : 'mdi:cast-connected'}"
  ...

@ipodmusicman
Copy link
Author

I thought it was a bug based on the default media player behavior. I don't need it currently, but thought I'd log it to get it addressed to match the consistency of the default media player behavior.

@kalkih
Copy link
Owner

kalkih commented Jan 8, 2020

Entity icon color based on state is now supported, although disabled by default.

See the new icon_state option in the hide option object

Enable icon state color:

- type: custom:mini-media-player
  ...
  hide:
    icon_state: false

Thanks!

@kalkih kalkih closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants