1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add alexa check for "name" channelMetadata attribute (#29279)

* Added check for "name" channelMetada attribute

* Added/changed smart home media player tests for added value name in chanelMetadata payload section

* Since Alexa only expects a number/callSign/affiliate in the returned response, returning "name" is not technically valid.  Modified to return the value in the callSign field  instead since it's a text value. Since there is no returned channel number, cannot return a true numeric value in "channel" field
This commit is contained in:
Alain Turbide
2019-12-02 19:10:44 -05:00
committed by Paulus Schoutsen
parent 9811d63d78
commit 83b21651ce
2 changed files with 29 additions and 13 deletions

View File

@@ -935,7 +935,7 @@ async def test_media_player(hass):
"media_player#test",
"media_player.play_media",
hass,
payload={"channel": {"number": 24}},
payload={"channel": {"number": "24"}, "channelMetadata": {"name": ""}},
)
call, _ = await assert_request_calls_service(
@@ -944,7 +944,7 @@ async def test_media_player(hass):
"media_player#test",
"media_player.play_media",
hass,
payload={"channel": {"callSign": "ABC"}},
payload={"channel": {"callSign": "ABC"}, "channelMetadata": {"name": ""}},
)
call, _ = await assert_request_calls_service(
@@ -953,7 +953,7 @@ async def test_media_player(hass):
"media_player#test",
"media_player.play_media",
hass,
payload={"channel": {"affiliateCallSign": "ABC"}},
payload={"channel": {"number": ""}, "channelMetadata": {"name": "ABC"}},
)
call, _ = await assert_request_calls_service(
@@ -962,7 +962,19 @@ async def test_media_player(hass):
"media_player#test",
"media_player.play_media",
hass,
payload={"channel": {"uri": "ABC"}},
payload={
"channel": {"affiliateCallSign": "ABC"},
"channelMetadata": {"name": ""},
},
)
call, _ = await assert_request_calls_service(
"Alexa.ChannelController",
"ChangeChannel",
"media_player#test",
"media_player.play_media",
hass,
payload={"channel": {"uri": "ABC"}, "channelMetadata": {"name": ""}},
)
call, _ = await assert_request_calls_service(