Add sw_version and connections to sonos devices (#35743)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-05-17 16:16:50 -05:00
1 parent f085fb1499
commit 03b14c9aae
3 files changed
+26 -1

No files matched your search

+6 -1
View File
@@ -69,4 +69,9 @@ def music_library_fixture():
@pytest.fixture(name="speaker_info")
def speaker_info_fixture():
"""Create speaker_info fixture."""
return {"zone_name": "Zone A", "model_name": "Model Name"}
return {
"zone_name": "Zone A",
"model_name": "Model Name",
"software_version": "49.2-64250",
"mac_address": "00-11-22-33-44-55",
}
@@ -42,3 +42,18 @@ async def test_services(hass, config_entry, config, hass_read_only_user):
blocking=True,
context=Context(user_id=hass_read_only_user.id),
)
async def test_device_registry(hass, config_entry, config, soco):
"""Test sonos device registered in the device registry."""
await setup_platform(hass, config_entry, config)
device_registry = await hass.helpers.device_registry.async_get_registry()
reg_device = device_registry.async_get_device(
identifiers={("sonos", "RINCON_test")}, connections=set(),
)
assert reg_device.model == "Model Name"
assert reg_device.sw_version == "49.2-64250"
assert reg_device.connections == {("mac", "00:11:22:33:44:55")}
assert reg_device.manufacturer == "Sonos"
assert reg_device.name == "Zone A"