forked from home-assistant/core
Bugfixes for media player more info dialog
This commit is contained in:
@@ -29,7 +29,8 @@
|
|||||||
<div class='layout horizontal'>
|
<div class='layout horizontal'>
|
||||||
<div class='flex'>
|
<div class='flex'>
|
||||||
<paper-icon-button icon='power-settings-new' highlight$='[[isOff]]'
|
<paper-icon-button icon='power-settings-new' highlight$='[[isOff]]'
|
||||||
on-tap='handleTogglePower'></paper-icon-button>
|
on-tap='handleTogglePower'
|
||||||
|
hidden$='[[computeHidePowerButton(isOff, supportsTurnOn, supportsTurnOff)]]'></paper-icon-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<template is='dom-if' if='[[!isOff]]'>
|
<template is='dom-if' if='[[!isOff]]'>
|
||||||
@@ -46,7 +47,7 @@
|
|||||||
<paper-icon-button on-tap="handleVolumeTap"
|
<paper-icon-button on-tap="handleVolumeTap"
|
||||||
icon="[[computeMuteVolumeIcon(isMuted)]]"></paper-icon-button>
|
icon="[[computeMuteVolumeIcon(isMuted)]]"></paper-icon-button>
|
||||||
<paper-slider disabled$='[[isMuted]]'
|
<paper-slider disabled$='[[isMuted]]'
|
||||||
min='0' max='100' value='{{volumeSliderValue}}'
|
min='0' max='100' value='[[volumeSliderValue]]'
|
||||||
on-change='volumeSliderChanged' class='flex'>
|
on-change='volumeSliderChanged' class='flex'>
|
||||||
</paper-slider>
|
</paper-slider>
|
||||||
</div>
|
</div>
|
||||||
@@ -154,10 +155,6 @@
|
|||||||
return stateObj.state == 'off';
|
return stateObj.state == 'off';
|
||||||
},
|
},
|
||||||
|
|
||||||
computePowerButtonCaption: function(isOff) {
|
|
||||||
return isOff ? 'Turn on' : 'Turn off';
|
|
||||||
},
|
|
||||||
|
|
||||||
computeMuteVolumeIcon: function(isMuted) {
|
computeMuteVolumeIcon: function(isMuted) {
|
||||||
return isMuted ? 'av:volume-off' : 'av:volume-up';
|
return isMuted ? 'av:volume-off' : 'av:volume-up';
|
||||||
},
|
},
|
||||||
@@ -169,6 +166,10 @@
|
|||||||
return 'av:play-arrow';
|
return 'av:play-arrow';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computeHidePowerButton: function(isOff, supportsTurnOn, supportsTurnOff) {
|
||||||
|
return isOff && !supportsTurnOn || !isOff && supportsTurnOff;
|
||||||
|
},
|
||||||
|
|
||||||
handleTogglePower: function() {
|
handleTogglePower: function() {
|
||||||
this.callService(this.isOff ? 'turn_on' : 'turn_off');
|
this.callService(this.isOff ? 'turn_on' : 'turn_off');
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user