media-row: fix when to show power toggle (#5379)

This commit is contained in:
Ian Richardson 2020-03-31 12:49:59 -05:00 committed by GitHub
parent 6692fa439a
commit 5f467f82e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,9 +100,10 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow {
.config=${this._config}
.secondaryText=${this._computeMediaTitle(stateObj)}
>
${stateObj.state === "off" || stateObj.state === "idle"
? supportsFeature(stateObj, SUPPORT_TURN_ON)
: supportsFeature(stateObj, SUPPORT_TURN_OFF)
${(supportsFeature(stateObj, SUPPORT_TURN_ON) &&
(stateObj.state === "off" || stateObj.state === "idle")) ||
(supportsFeature(stateObj, SUPPORT_TURN_OFF) &&
stateObj.state !== "off")
? html`
<paper-icon-button
icon="hass:power"