mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 13:26:34 +00:00
Fix ES2015 syntax in media-player-model
This commit is contained in:
parent
cf6bddd7a9
commit
594f143ad0
@ -132,27 +132,27 @@
|
||||
});
|
||||
|
||||
Object.assign(window.MediaPlayerEntity.prototype, {
|
||||
mediaPlayPause() {
|
||||
mediaPlayPause: function () {
|
||||
this.callService('media_play_pause');
|
||||
},
|
||||
|
||||
nextTrack() {
|
||||
nextTrack: function () {
|
||||
this.callService('media_next_track');
|
||||
},
|
||||
|
||||
playbackControl() {
|
||||
playbackControl: function () {
|
||||
this.callService('media_play_pause');
|
||||
},
|
||||
|
||||
previousTrack() {
|
||||
previousTrack: function () {
|
||||
this.callService('media_previous_track');
|
||||
},
|
||||
|
||||
setVolume(volume) {
|
||||
setVolume: function (volume) {
|
||||
this.callService('volume_set', { volume_level: volume });
|
||||
},
|
||||
|
||||
togglePower() {
|
||||
togglePower: function () {
|
||||
if (this.isOff) {
|
||||
this.turnOn();
|
||||
} else {
|
||||
@ -160,32 +160,32 @@
|
||||
}
|
||||
},
|
||||
|
||||
turnOff() {
|
||||
turnOff: function () {
|
||||
this.callService('turn_off');
|
||||
},
|
||||
|
||||
turnOn() {
|
||||
turnOn: function () {
|
||||
this.callService('turn_on');
|
||||
},
|
||||
|
||||
volumeDown() {
|
||||
volumeDown: function () {
|
||||
this.callService('volume_down');
|
||||
},
|
||||
|
||||
volumeMute(mute) {
|
||||
volumeMute: function (mute) {
|
||||
if (!this.supportsVolumeMute) {
|
||||
throw new Error('Muting volume not supported');
|
||||
}
|
||||
this.callService('volume_mute', { is_volume_muted: mute });
|
||||
},
|
||||
|
||||
volumeUp() {
|
||||
volumeUp: function () {
|
||||
this.callService('volume_up');
|
||||
},
|
||||
|
||||
// helper method
|
||||
|
||||
callService(service, data) {
|
||||
callService: function (service, data) {
|
||||
var serviceData = data || {};
|
||||
serviceData.entity_id = this.stateObj.entity_id;
|
||||
this.hass.callService('media_player', service, serviceData);
|
||||
|
Loading…
x
Reference in New Issue
Block a user