Skip to content

Commit

Permalink
Fix async_volume_up / async_volume_down (#5249)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
glance- authored and balloob committed Jan 10, 2017
1 parent 0b685a5 commit 7e1629a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/media_player/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ def async_volume_up(self):
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."""
Expand All @@ -770,7 +770,7 @@ def async_volume_down(self):
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."""
Expand Down

0 comments on commit 7e1629a

Please sign in to comment.