Guard for non-string inputs in Alexa (#67348)
parent
f9b02d5cab
commit
9c440d8aa6
|
@ -822,6 +822,8 @@ class AlexaInputController(AlexaCapability):
|
|||
"""Return list of supported inputs."""
|
||||
input_list = []
|
||||
for source in source_list:
|
||||
if not isinstance(source, str):
|
||||
continue
|
||||
formatted_source = (
|
||||
source.lower().replace("-", "").replace("_", "").replace(" ", "")
|
||||
)
|
||||
|
|
|
@ -182,7 +182,7 @@ async def test_api_increase_color_temp(hass, result, initial):
|
|||
@pytest.mark.parametrize(
|
||||
"domain,payload,source_list,idx",
|
||||
[
|
||||
("media_player", "GAME CONSOLE", ["tv", "game console"], 1),
|
||||
("media_player", "GAME CONSOLE", ["tv", "game console", 10000], 1),
|
||||
("media_player", "SATELLITE TV", ["satellite-tv", "game console"], 0),
|
||||
("media_player", "SATELLITE TV", ["satellite_tv", "game console"], 0),
|
||||
("media_player", "BAD DEVICE", ["satellite_tv", "game console"], None),
|
||||
|
|
Loading…
Reference in New Issue