mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Show +/- volume buttons for media players which support VOLUME_SET (#19111)
* Show +/- volume buttons for media players which support VOLUME_SET * Fixup
This commit is contained in:
parent
f5d13c9079
commit
d7826e4e6c
@ -90,7 +90,7 @@ export const enum MediaPlayerEntityFeature {
|
|||||||
TURN_ON = 128,
|
TURN_ON = 128,
|
||||||
TURN_OFF = 256,
|
TURN_OFF = 256,
|
||||||
PLAY_MEDIA = 512,
|
PLAY_MEDIA = 512,
|
||||||
VOLUME_BUTTONS = 1024,
|
VOLUME_STEP = 1024,
|
||||||
SELECT_SOURCE = 2048,
|
SELECT_SOURCE = 2048,
|
||||||
STOP = 4096,
|
STOP = 4096,
|
||||||
CLEAR_PLAYLIST = 8192,
|
CLEAR_PLAYLIST = 8192,
|
||||||
|
@ -81,7 +81,7 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
: ""}
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
${(supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_SET) ||
|
${(supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_SET) ||
|
||||||
supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_BUTTONS)) &&
|
supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_STEP)) &&
|
||||||
stateActive(stateObj)
|
stateActive(stateObj)
|
||||||
? html`
|
? html`
|
||||||
<div class="volume">
|
<div class="volume">
|
||||||
@ -104,8 +104,9 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
: ""}
|
: ""}
|
||||||
${supportsFeature(
|
${supportsFeature(
|
||||||
stateObj,
|
stateObj,
|
||||||
MediaPlayerEntityFeature.VOLUME_BUTTONS
|
MediaPlayerEntityFeature.VOLUME_SET
|
||||||
)
|
) ||
|
||||||
|
supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_STEP)
|
||||||
? html`
|
? html`
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
action="volume_down"
|
action="volume_down"
|
||||||
|
@ -208,10 +208,7 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow {
|
|||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
`
|
`
|
||||||
: !supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_SET) &&
|
: !supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_SET) &&
|
||||||
!supportsFeature(
|
!supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_STEP)
|
||||||
stateObj,
|
|
||||||
MediaPlayerEntityFeature.VOLUME_BUTTONS
|
|
||||||
)
|
|
||||||
? buttons
|
? buttons
|
||||||
: ""}
|
: ""}
|
||||||
${supportsFeature(stateObj, MediaPlayerEntityFeature.TURN_OFF) &&
|
${supportsFeature(stateObj, MediaPlayerEntityFeature.TURN_OFF) &&
|
||||||
@ -226,8 +223,8 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow {
|
|||||||
: ""}
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
</hui-generic-entity-row>
|
</hui-generic-entity-row>
|
||||||
${(supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_SET) ||
|
${(supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_STEP) ||
|
||||||
supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_BUTTONS)) &&
|
supportsFeature(stateObj, MediaPlayerEntityFeature.VOLUME_SET)) &&
|
||||||
stateActive(stateObj)
|
stateActive(stateObj)
|
||||||
? html`
|
? html`
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
@ -266,7 +263,7 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow {
|
|||||||
: !this._veryNarrow &&
|
: !this._veryNarrow &&
|
||||||
supportsFeature(
|
supportsFeature(
|
||||||
stateObj,
|
stateObj,
|
||||||
MediaPlayerEntityFeature.VOLUME_BUTTONS
|
MediaPlayerEntityFeature.VOLUME_STEP
|
||||||
)
|
)
|
||||||
? html`
|
? html`
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user