Map Alexa StepVolume responses to volume_up/down (#12467)

It turns out I misunderstood which media_player services are available
when a media player supports StepVolume. This PR maps the Alexa
StepSpeaker messages to the volume_up and volume_down services.

Currently Alexa allows you to specify the number of steps but the media
player volume_up and volume_down services don't support this. For now I
just look to see if the steps are +/- and call up/down accordingly.
This commit is contained in:
Richard Lucas authored and Phil Frost committed 2018-02-17 08:54:15 -05:00
1 parent 3fd61d8f45
commit fab991bbf6
2 files changed
+15 -13

No files matched your search

+2 -4
View File
@@ -515,17 +515,15 @@ def test_media_player(hass):
call, _ = yield from assert_request_calls_service(
'Alexa.StepSpeaker', 'AdjustVolume', 'media_player#test',
'media_player.volume_set',
'media_player.volume_up',
hass,
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',
'media_player.volume_down',
hass,
payload={'volumeSteps': -20})
assert call.data['volume_level'] == 0.55
@asyncio.coroutine