mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Bugfixes for media player more info dialog
This commit is contained in:
parent
8e50f50a48
commit
801eabe598
@ -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');
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user