From 7e1629a962f645024b0ed8e93c4c1a236804ccb6 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Tue, 10 Jan 2017 10:58:39 +0100 Subject: [PATCH] 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 --- homeassistant/components/media_player/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index f5948e1eecd..1be94976d49 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -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."""