Rnm supported_media_commands to supported_features (#197)

This commit is contained in:
Adam Mills 2017-02-07 23:42:11 -05:00 committed by Paulus Schoutsen
parent 05760f9c21
commit bdd3157087
3 changed files with 23 additions and 23 deletions

View File

@ -203,7 +203,7 @@ addEntity('switch.ac', 'on', {
addEntity('media_player.living_room', 'playing', {
entity_picture: '/demo/images/thrones.jpg',
friendly_name: 'Chromecast',
supported_media_commands: 509,
supported_features: 509,
media_content_type: 'tvshow',
media_title: 'The Dance of Dragons',
media_series_title: 'Game of Thrones',

View File

@ -242,17 +242,17 @@ Polymer({
this.volumeSliderValue = newVal.attributes.volume_level * 100;
this.isMuted = newVal.attributes.is_volume_muted;
this.source = newVal.attributes.source;
this.supportsPause = (newVal.attributes.supported_media_commands & 1) !== 0;
this.supportsVolumeSet = (newVal.attributes.supported_media_commands & 4) !== 0;
this.supportsVolumeMute = (newVal.attributes.supported_media_commands & 8) !== 0;
this.supportsPreviousTrack = (newVal.attributes.supported_media_commands & 16) !== 0;
this.supportsNextTrack = (newVal.attributes.supported_media_commands & 32) !== 0;
this.supportsTurnOn = (newVal.attributes.supported_media_commands & 128) !== 0;
this.supportsTurnOff = (newVal.attributes.supported_media_commands & 256) !== 0;
this.supportsPlayMedia = (newVal.attributes.supported_media_commands & 512) !== 0;
this.supportsVolumeButtons = (newVal.attributes.supported_media_commands & 1024) !== 0;
this.supportsSelectSource = (newVal.attributes.supported_media_commands & 2048) !== 0;
this.supportsPlay = (newVal.attributes.supported_media_commands & 16384) !== 0;
this.supportsPause = (newVal.attributes.supported_features & 1) !== 0;
this.supportsVolumeSet = (newVal.attributes.supported_features & 4) !== 0;
this.supportsVolumeMute = (newVal.attributes.supported_features & 8) !== 0;
this.supportsPreviousTrack = (newVal.attributes.supported_features & 16) !== 0;
this.supportsNextTrack = (newVal.attributes.supported_features & 32) !== 0;
this.supportsTurnOn = (newVal.attributes.supported_features & 128) !== 0;
this.supportsTurnOff = (newVal.attributes.supported_features & 256) !== 0;
this.supportsPlayMedia = (newVal.attributes.supported_features & 512) !== 0;
this.supportsVolumeButtons = (newVal.attributes.supported_features & 1024) !== 0;
this.supportsSelectSource = (newVal.attributes.supported_features & 2048) !== 0;
this.supportsPlay = (newVal.attributes.supported_features & 16384) !== 0;
if (newVal.attributes.source_list !== undefined) {
this.sourceIndex = newVal.attributes.source_list.indexOf(this.source);

View File

@ -64,43 +64,43 @@
/* eslint-disable no-bitwise */
addGetter('supportsPause', function () {
return (this.stateObj.attributes.supported_media_commands & 1) !== 0;
return (this.stateObj.attributes.supported_features & 1) !== 0;
});
addGetter('supportsVolumeSet', function () {
return (this.stateObj.attributes.supported_media_commands & 4) !== 0;
return (this.stateObj.attributes.supported_features & 4) !== 0;
});
addGetter('supportsVolumeMute', function () {
return (this.stateObj.attributes.supported_media_commands & 8) !== 0;
return (this.stateObj.attributes.supported_features & 8) !== 0;
});
addGetter('supportsPreviousTrack', function () {
return (this.stateObj.attributes.supported_media_commands & 16) !== 0;
return (this.stateObj.attributes.supported_features & 16) !== 0;
});
addGetter('supportsNextTrack', function () {
return (this.stateObj.attributes.supported_media_commands & 32) !== 0;
return (this.stateObj.attributes.supported_features & 32) !== 0;
});
addGetter('supportsTurnOn', function () {
return (this.stateObj.attributes.supported_media_commands & 128) !== 0;
return (this.stateObj.attributes.supported_features & 128) !== 0;
});
addGetter('supportsTurnOff', function () {
return (this.stateObj.attributes.supported_media_commands & 256) !== 0;
return (this.stateObj.attributes.supported_features & 256) !== 0;
});
addGetter('supportsPlayMedia', function () {
return (this.stateObj.attributes.supported_media_commands & 512) !== 0;
return (this.stateObj.attributes.supported_features & 512) !== 0;
});
addGetter('supportsVolumeButtons', function () {
return (this.stateObj.attributes.supported_media_commands & 1024) !== 0;
return (this.stateObj.attributes.supported_features & 1024) !== 0;
});
addGetter('supportsPlay', function () {
return (this.stateObj.attributes.supported_media_commands & 16384) !== 0;
return (this.stateObj.attributes.supported_features & 16384) !== 0;
});
/* eslint-enable no-bitwise */
@ -192,4 +192,4 @@
},
});
}());
</script>
</script>