mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Fix TV input source option for Sonos Arc Ultra (#138778)
initial commit
This commit is contained in:
parent
a003f89a5e
commit
e9fcef1b57
@ -170,6 +170,7 @@ MODELS_TV_ONLY = (
|
|||||||
"BEAM",
|
"BEAM",
|
||||||
"PLAYBAR",
|
"PLAYBAR",
|
||||||
"PLAYBASE",
|
"PLAYBASE",
|
||||||
|
"ULTRA",
|
||||||
)
|
)
|
||||||
MODELS_LINEIN_AND_TV = ("AMP",)
|
MODELS_LINEIN_AND_TV = ("AMP",)
|
||||||
|
|
||||||
|
@ -580,13 +580,19 @@ def alarm_clock_fixture_extended():
|
|||||||
return alarm_clock
|
return alarm_clock
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(name="speaker_model")
|
||||||
|
def speaker_model_fixture(request: pytest.FixtureRequest):
|
||||||
|
"""Create fixture for the speaker model."""
|
||||||
|
return getattr(request, "param", "Model Name")
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="speaker_info")
|
@pytest.fixture(name="speaker_info")
|
||||||
def speaker_info_fixture():
|
def speaker_info_fixture(speaker_model):
|
||||||
"""Create speaker_info fixture."""
|
"""Create speaker_info fixture."""
|
||||||
return {
|
return {
|
||||||
"zone_name": "Zone A",
|
"zone_name": "Zone A",
|
||||||
"uid": "RINCON_test",
|
"uid": "RINCON_test",
|
||||||
"model_name": "Model Name",
|
"model_name": speaker_model,
|
||||||
"model_number": "S12",
|
"model_number": "S12",
|
||||||
"hardware_version": "1.20.1.6-1.1",
|
"hardware_version": "1.20.1.6-1.1",
|
||||||
"software_version": "49.2-64250",
|
"software_version": "49.2-64250",
|
||||||
|
@ -10,6 +10,7 @@ from syrupy import SnapshotAssertion
|
|||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
ATTR_INPUT_SOURCE,
|
ATTR_INPUT_SOURCE,
|
||||||
|
ATTR_INPUT_SOURCE_LIST,
|
||||||
ATTR_MEDIA_ANNOUNCE,
|
ATTR_MEDIA_ANNOUNCE,
|
||||||
ATTR_MEDIA_CONTENT_ID,
|
ATTR_MEDIA_CONTENT_ID,
|
||||||
ATTR_MEDIA_CONTENT_TYPE,
|
ATTR_MEDIA_CONTENT_TYPE,
|
||||||
@ -1205,3 +1206,27 @@ async def test_media_get_queue(
|
|||||||
)
|
)
|
||||||
soco_mock.get_queue.assert_called_with(max_items=0)
|
soco_mock.get_queue.assert_called_with(max_items=0)
|
||||||
assert result == snapshot
|
assert result == snapshot
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
("speaker_model", "source_list"),
|
||||||
|
[
|
||||||
|
("Sonos Arc Ultra", [SOURCE_TV]),
|
||||||
|
("Sonos Arc", [SOURCE_TV]),
|
||||||
|
("Sonos Playbar", [SOURCE_TV]),
|
||||||
|
("Sonos Connect", [SOURCE_LINEIN]),
|
||||||
|
("Sonos Play:5", [SOURCE_LINEIN]),
|
||||||
|
("Sonos Amp", [SOURCE_LINEIN, SOURCE_TV]),
|
||||||
|
("Sonos Era", None),
|
||||||
|
],
|
||||||
|
indirect=["speaker_model"],
|
||||||
|
)
|
||||||
|
async def test_media_source_list(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
async_autosetup_sonos,
|
||||||
|
speaker_model: str,
|
||||||
|
source_list: list[str] | None,
|
||||||
|
) -> None:
|
||||||
|
"""Test the mapping between the speaker model name and source_list."""
|
||||||
|
state = hass.states.get("media_player.zone_a")
|
||||||
|
assert state.attributes.get(ATTR_INPUT_SOURCE_LIST) == source_list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user