mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 08:46:35 +00:00
Rnm supported_media_commands to supported_features (#197)
This commit is contained in:
parent
05760f9c21
commit
bdd3157087
@ -203,7 +203,7 @@ addEntity('switch.ac', 'on', {
|
|||||||
addEntity('media_player.living_room', 'playing', {
|
addEntity('media_player.living_room', 'playing', {
|
||||||
entity_picture: '/demo/images/thrones.jpg',
|
entity_picture: '/demo/images/thrones.jpg',
|
||||||
friendly_name: 'Chromecast',
|
friendly_name: 'Chromecast',
|
||||||
supported_media_commands: 509,
|
supported_features: 509,
|
||||||
media_content_type: 'tvshow',
|
media_content_type: 'tvshow',
|
||||||
media_title: 'The Dance of Dragons',
|
media_title: 'The Dance of Dragons',
|
||||||
media_series_title: 'Game of Thrones',
|
media_series_title: 'Game of Thrones',
|
||||||
|
@ -242,17 +242,17 @@ Polymer({
|
|||||||
this.volumeSliderValue = newVal.attributes.volume_level * 100;
|
this.volumeSliderValue = newVal.attributes.volume_level * 100;
|
||||||
this.isMuted = newVal.attributes.is_volume_muted;
|
this.isMuted = newVal.attributes.is_volume_muted;
|
||||||
this.source = newVal.attributes.source;
|
this.source = newVal.attributes.source;
|
||||||
this.supportsPause = (newVal.attributes.supported_media_commands & 1) !== 0;
|
this.supportsPause = (newVal.attributes.supported_features & 1) !== 0;
|
||||||
this.supportsVolumeSet = (newVal.attributes.supported_media_commands & 4) !== 0;
|
this.supportsVolumeSet = (newVal.attributes.supported_features & 4) !== 0;
|
||||||
this.supportsVolumeMute = (newVal.attributes.supported_media_commands & 8) !== 0;
|
this.supportsVolumeMute = (newVal.attributes.supported_features & 8) !== 0;
|
||||||
this.supportsPreviousTrack = (newVal.attributes.supported_media_commands & 16) !== 0;
|
this.supportsPreviousTrack = (newVal.attributes.supported_features & 16) !== 0;
|
||||||
this.supportsNextTrack = (newVal.attributes.supported_media_commands & 32) !== 0;
|
this.supportsNextTrack = (newVal.attributes.supported_features & 32) !== 0;
|
||||||
this.supportsTurnOn = (newVal.attributes.supported_media_commands & 128) !== 0;
|
this.supportsTurnOn = (newVal.attributes.supported_features & 128) !== 0;
|
||||||
this.supportsTurnOff = (newVal.attributes.supported_media_commands & 256) !== 0;
|
this.supportsTurnOff = (newVal.attributes.supported_features & 256) !== 0;
|
||||||
this.supportsPlayMedia = (newVal.attributes.supported_media_commands & 512) !== 0;
|
this.supportsPlayMedia = (newVal.attributes.supported_features & 512) !== 0;
|
||||||
this.supportsVolumeButtons = (newVal.attributes.supported_media_commands & 1024) !== 0;
|
this.supportsVolumeButtons = (newVal.attributes.supported_features & 1024) !== 0;
|
||||||
this.supportsSelectSource = (newVal.attributes.supported_media_commands & 2048) !== 0;
|
this.supportsSelectSource = (newVal.attributes.supported_features & 2048) !== 0;
|
||||||
this.supportsPlay = (newVal.attributes.supported_media_commands & 16384) !== 0;
|
this.supportsPlay = (newVal.attributes.supported_features & 16384) !== 0;
|
||||||
|
|
||||||
if (newVal.attributes.source_list !== undefined) {
|
if (newVal.attributes.source_list !== undefined) {
|
||||||
this.sourceIndex = newVal.attributes.source_list.indexOf(this.source);
|
this.sourceIndex = newVal.attributes.source_list.indexOf(this.source);
|
||||||
|
@ -64,43 +64,43 @@
|
|||||||
/* eslint-disable no-bitwise */
|
/* eslint-disable no-bitwise */
|
||||||
|
|
||||||
addGetter('supportsPause', function () {
|
addGetter('supportsPause', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 1) !== 0;
|
return (this.stateObj.attributes.supported_features & 1) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
addGetter('supportsVolumeSet', function () {
|
addGetter('supportsVolumeSet', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 4) !== 0;
|
return (this.stateObj.attributes.supported_features & 4) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
addGetter('supportsVolumeMute', function () {
|
addGetter('supportsVolumeMute', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 8) !== 0;
|
return (this.stateObj.attributes.supported_features & 8) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
addGetter('supportsPreviousTrack', function () {
|
addGetter('supportsPreviousTrack', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 16) !== 0;
|
return (this.stateObj.attributes.supported_features & 16) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
addGetter('supportsNextTrack', function () {
|
addGetter('supportsNextTrack', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 32) !== 0;
|
return (this.stateObj.attributes.supported_features & 32) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
addGetter('supportsTurnOn', function () {
|
addGetter('supportsTurnOn', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 128) !== 0;
|
return (this.stateObj.attributes.supported_features & 128) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
addGetter('supportsTurnOff', function () {
|
addGetter('supportsTurnOff', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 256) !== 0;
|
return (this.stateObj.attributes.supported_features & 256) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
addGetter('supportsPlayMedia', function () {
|
addGetter('supportsPlayMedia', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 512) !== 0;
|
return (this.stateObj.attributes.supported_features & 512) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
addGetter('supportsVolumeButtons', function () {
|
addGetter('supportsVolumeButtons', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 1024) !== 0;
|
return (this.stateObj.attributes.supported_features & 1024) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
addGetter('supportsPlay', function () {
|
addGetter('supportsPlay', function () {
|
||||||
return (this.stateObj.attributes.supported_media_commands & 16384) !== 0;
|
return (this.stateObj.attributes.supported_features & 16384) !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
/* eslint-enable no-bitwise */
|
/* eslint-enable no-bitwise */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user