home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
3.95k stars 2.67k forks source link

Add "Hide when unavailable" toggle to Lovelace Media Control card #4472

Closed SeanPM5 closed 4 years ago

SeanPM5 commented 4 years ago

Streaming sticks like Chromecast and Roku are super popular devices. Often these are powered by the USB port on the television, so whenever the TV is turned off, the media player becomes unavailable too.

One of the most common use cases I see for conditional cards is to hide media players that are unavailable. This isn't too user friendly currently - it requires knowledge of conditional cards and YAML. I think it could be a lot simpler:

media-control-unavailable

A toggle to hide the media control card when the media player is unavailable. Would basically add the necessary conditional card.

type: conditional
conditions:
  - entity: media_player.living_room_roku
    state_not: "unavailable"
card:
  type: media-control
  entity: media_player.living_room_roku

I don't know the logistics of this, would it break the preview since it'd be considered a conditional card and there's no UI editor for that? etc. But I think it'd make this common use case a lot easier.

iantrich commented 4 years ago

I would probably lean towards direct support for this in the media card (which still needs to be rewritten)

frenck commented 4 years ago

unavailable is a state that applied to every entity... Why just media players? Extreme example: My Christmas tree is only available at the end of the year...

zsarnett commented 4 years ago

With the new media card, I don't believe this is much of an issue. It is very small and grey