mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Media players can support turn off without turn on (#148)
This commit is contained in:
parent
d2ff6a18e1
commit
ab187a7a84
@ -151,7 +151,7 @@
|
|||||||
<paper-icon-button
|
<paper-icon-button
|
||||||
icon='mdi:power'
|
icon='mdi:power'
|
||||||
on-tap='handleTogglePower'
|
on-tap='handleTogglePower'
|
||||||
invisible$='[[!playerObj.supportsTurnOff]]'
|
invisible$='[[computeHidePowerButton(playerObj)]]'
|
||||||
class='self-center secondary'
|
class='self-center secondary'
|
||||||
></paper-icon-button>
|
></paper-icon-button>
|
||||||
|
|
||||||
@ -246,8 +246,8 @@ Polymer({
|
|||||||
return cls;
|
return cls;
|
||||||
},
|
},
|
||||||
|
|
||||||
computeHidePowerOnButton: function (playerObj) {
|
computeHidePowerButton: function (playerObj) {
|
||||||
return !playerObj.isOff || !playerObj.supportsTurnOn;
|
return playerObj.isOff ? !playerObj.supportsTurnOn : !playerObj.supportsTurnOff;
|
||||||
},
|
},
|
||||||
|
|
||||||
computePlayerObj: function (stateObj) {
|
computePlayerObj: function (stateObj) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user