Fix async_volume_up / async_volume_down (#5249)
async_volume_up / async_volume_down should be async versions of volume_up / volume_down, not a async version of the default variants of volume_up / volume_down. The previous code always called into the mediaplayers set_volume_level, and never into volume_up / volume_down. Signed-off-by: Anton Lundin <glance@acc.umu.se>pull/5214/merge
parent
0b685a5b1e
commit
7e1629a962
|
@ -758,7 +758,7 @@ class MediaPlayerDevice(Entity):
|
|||
|
||||
This method must be run in the event loop and returns a coroutine.
|
||||
"""
|
||||
return self.async_set_volume_level(min(1, self.volume_level + .1))
|
||||
return self.hass.loop.run_in_executor(None, self.volume_up)
|
||||
|
||||
def volume_down(self):
|
||||
"""Turn volume down for media player."""
|
||||
|
@ -770,7 +770,7 @@ class MediaPlayerDevice(Entity):
|
|||
|
||||
This method must be run in the event loop and returns a coroutine.
|
||||
"""
|
||||
return self.async_set_volume_level(max(0, self.volume_level - .1))
|
||||
return self.hass.loop.run_in_executor(None, self.volume_down)
|
||||
|
||||
def media_play_pause(self):
|
||||
"""Play or pause the media player."""
|
||||
|
|
Loading…
Reference in New Issue