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_statetoTrueandstatetoSTATE_ON/STATE_PLAYING/STATE_PAUSED/STATE_IDLEwill 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_statetoTrue: 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_stateto 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_stateisTrueand state ison/playing/idle/paused:Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: