Skip to content

Commit

Permalink
Fix Alexa Step Volume (#12314)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasweb78 authored and balloob committed Feb 11, 2018
1 parent e4a826d commit 767d3c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/alexa/smart_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions tests/components/alexa/test_smart_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 767d3c6

Please sign in to comment.