mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Support setting explicit mute value for Panasonic Viera TV (#13954)
* Use module's methods instead of API calls * Use module's methods instead of API calls for media commands
This commit is contained in:
parent
b00f771541
commit
bf53cbe08d
@ -138,20 +138,20 @@ class PanasonicVieraTVDevice(MediaPlayerDevice):
|
|||||||
def turn_off(self):
|
def turn_off(self):
|
||||||
"""Turn off media player."""
|
"""Turn off media player."""
|
||||||
if self._state != STATE_OFF:
|
if self._state != STATE_OFF:
|
||||||
self.send_key('NRC_POWER-ONOFF')
|
self._remote.turn_off()
|
||||||
self._state = STATE_OFF
|
self._state = STATE_OFF
|
||||||
|
|
||||||
def volume_up(self):
|
def volume_up(self):
|
||||||
"""Volume up the media player."""
|
"""Volume up the media player."""
|
||||||
self.send_key('NRC_VOLUP-ONOFF')
|
self._remote.volume_up()
|
||||||
|
|
||||||
def volume_down(self):
|
def volume_down(self):
|
||||||
"""Volume down media player."""
|
"""Volume down media player."""
|
||||||
self.send_key('NRC_VOLDOWN-ONOFF')
|
self._remote.volume_down()
|
||||||
|
|
||||||
def mute_volume(self, mute):
|
def mute_volume(self, mute):
|
||||||
"""Send mute command."""
|
"""Send mute command."""
|
||||||
self.send_key('NRC_MUTE-ONOFF')
|
self._remote.set_mute(mute)
|
||||||
|
|
||||||
def set_volume_level(self, volume):
|
def set_volume_level(self, volume):
|
||||||
"""Set volume level, range 0..1."""
|
"""Set volume level, range 0..1."""
|
||||||
@ -172,20 +172,20 @@ class PanasonicVieraTVDevice(MediaPlayerDevice):
|
|||||||
def media_play(self):
|
def media_play(self):
|
||||||
"""Send play command."""
|
"""Send play command."""
|
||||||
self._playing = True
|
self._playing = True
|
||||||
self.send_key('NRC_PLAY-ONOFF')
|
self._remote.media_play()
|
||||||
|
|
||||||
def media_pause(self):
|
def media_pause(self):
|
||||||
"""Send media pause command to media player."""
|
"""Send media pause command to media player."""
|
||||||
self._playing = False
|
self._playing = False
|
||||||
self.send_key('NRC_PAUSE-ONOFF')
|
self._remote.media_pause()
|
||||||
|
|
||||||
def media_next_track(self):
|
def media_next_track(self):
|
||||||
"""Send next track command."""
|
"""Send next track command."""
|
||||||
self.send_key('NRC_FF-ONOFF')
|
self._remote.media_next_track()
|
||||||
|
|
||||||
def media_previous_track(self):
|
def media_previous_track(self):
|
||||||
"""Send the previous track command."""
|
"""Send the previous track command."""
|
||||||
self.send_key('NRC_REW-ONOFF')
|
self._remote.media_previous_track()
|
||||||
|
|
||||||
def play_media(self, media_type, media_id, **kwargs):
|
def play_media(self, media_type, media_id, **kwargs):
|
||||||
"""Play media."""
|
"""Play media."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user