From 767d3c6206916d1ae2236cce62d0e313ad32fcdf Mon Sep 17 00:00:00 2001 From: Richard Lucas Date: Sun, 11 Feb 2018 11:25:05 -0800 Subject: [PATCH] Fix Alexa Step Volume (#12314) --- homeassistant/components/alexa/smart_home.py | 2 +- tests/components/alexa/test_smart_home.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/alexa/smart_home.py b/homeassistant/components/alexa/smart_home.py index 354a612c4b8..e9b1b845d3d 100644 --- a/homeassistant/components/alexa/smart_home.py +++ b/homeassistant/components/alexa/smart_home.py @@ -1168,7 +1168,7 @@ def async_api_adjust_volume(hass, config, request, entity): @asyncio.coroutine def async_api_adjust_volume_step(hass, config, request, entity): """Process an adjust volume step request.""" - volume_step = round(float(request[API_PAYLOAD]['volume'] / 100), 2) + volume_step = round(float(request[API_PAYLOAD]['volumeSteps'] / 100), 2) current_level = entity.attributes.get(media_player.ATTR_MEDIA_VOLUME_LEVEL) diff --git a/tests/components/alexa/test_smart_home.py b/tests/components/alexa/test_smart_home.py index 71485231150..487ff301c18 100644 --- a/tests/components/alexa/test_smart_home.py +++ b/tests/components/alexa/test_smart_home.py @@ -511,14 +511,14 @@ def test_media_player(hass): 'Alexa.StepSpeaker', 'AdjustVolume', 'media_player#test', 'media_player.volume_set', hass, - payload={'volume': 20}) + payload={'volumeSteps': 20}) assert call.data['volume_level'] == 0.95 call, _ = yield from assert_request_calls_service( 'Alexa.StepSpeaker', 'AdjustVolume', 'media_player#test', 'media_player.volume_set', hass, - payload={'volume': -20}) + payload={'volumeSteps': -20}) assert call.data['volume_level'] == 0.55