FIX enable volume commands for non-coordinators too

pull/1659/head
Alexander Fortin 2016-03-31 21:36:58 +02:00
parent bcb0eb53f3
commit b304b77005
1 changed files with 5 additions and 9 deletions

View File

@ -197,31 +197,27 @@ class SonosDevice(MediaPlayerDevice):
"""Flag of media commands that are supported."""
return SUPPORT_SONOS
@only_if_coordinator
def turn_off(self):
"""Turn off media player."""
self._player.pause()
@only_if_coordinator
def volume_up(self):
"""Volume up media player."""
self._player.volume += 1
@only_if_coordinator
def volume_down(self):
"""Volume down media player."""
self._player.volume -= 1
@only_if_coordinator
def set_volume_level(self, volume):
"""Set volume level, range 0..1."""
self._player.volume = str(int(volume * 100))
@only_if_coordinator
def mute_volume(self, mute):
"""Mute (true) or unmute (false) media player."""
self._player.mute = mute
@only_if_coordinator
def turn_off(self):
"""Turn off media player."""
self._player.pause()
@only_if_coordinator
def media_play(self):
"""Send play command."""