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
Add support for media player assumed state #11642
Conversation
Do we need to show both pause and stop? IIRC the current coding is giving one of the two precedence over the other. Does that have to change with the new |
Also, there should be a few more coding places where the logic needs to be changed such as the media player row. |
This implementation does add an additional button to the media player card, I tried to think of a way to keep it smaller, but any other option would still require the core integration to implement logic which is not aligned with the device capabilities or just drop one of the options. |
Can you point me to the places that needs to be changed? Thanks |
The logic looks good if Elupus comment is integrated. Spacegaier is right, we should ensure all places are either using this media controls method or are updated. Looks like just 1 spot left:
|
Added assumed state in
And the comment from @elupus (assumed state behave the same on any sate which is not unavailable/unknown/off) |
Breaking change
The frontend media player card for integrations which sets the
assumed_state
toTrue
andstate
toSTATE_ON
/STATE_PLAYING
/STATE_PAUSED
/STATE_IDLE
will change from:to:
The example assumes the following supported features are set:
SUPPORT_PREVIOUS_TRACK
,SUPPORT_PLAY
,SUPPORT_PAUSE
,SUPPORT_STOP
,SUPPORT_NEXT_TRACK
, if one of them is not set the corresponding button will not be displayed.Currently there is one core integration which sets the
assumed_state
toTrue
: xiaomi_tv, but it does not set any of the required supported features to cause the media card to change.Custom integrations which meets these conditions will also have the frontend card changed.
Proposed change
Discussed in home-assistant/architecture#720, Add support for media player integrations which does not have a feedback from the device for the current playing mode (playing/paused/idle), if the integration sets the
assumed_state
to true the frontend will display all supported features in case the current state isSTATE_ON
/STATE_PLAYING
/STATE_PAUSED
/STATE_IDLE
.Current behavior:
New options when
assumed_state
isTrue
and state ison/playing/idle/paused
:Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: