mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Add UPNP device connection for Sonos (#56702)
This commit is contained in:
parent
70cc6295b5
commit
805e73f78c
@ -95,7 +95,10 @@ class SonosEntity(Entity):
|
||||
"name": self.speaker.zone_name,
|
||||
"model": self.speaker.model_name.replace("Sonos ", ""),
|
||||
"sw_version": self.speaker.version,
|
||||
"connections": {(dr.CONNECTION_NETWORK_MAC, self.speaker.mac_address)},
|
||||
"connections": {
|
||||
(dr.CONNECTION_NETWORK_MAC, self.speaker.mac_address),
|
||||
(dr.CONNECTION_UPNP, f"uuid:{self.speaker.uid}"),
|
||||
},
|
||||
"manufacturer": "Sonos",
|
||||
"suggested_area": self.speaker.zone_name,
|
||||
}
|
||||
|
@ -177,6 +177,7 @@ class SonosSpeaker:
|
||||
# Device information
|
||||
self.mac_address = speaker_info["mac_address"]
|
||||
self.model_name = speaker_info["model_name"]
|
||||
self.uid = speaker_info["uid"]
|
||||
self.version = speaker_info["display_version"]
|
||||
self.zone_name = speaker_info["zone_name"]
|
||||
|
||||
|
@ -160,6 +160,7 @@ def speaker_info_fixture():
|
||||
"""Create speaker_info fixture."""
|
||||
return {
|
||||
"zone_name": "Zone A",
|
||||
"uid": "RINCON_test",
|
||||
"model_name": "Model Name",
|
||||
"software_version": "49.2-64250",
|
||||
"mac_address": "00-11-22-33-44-55",
|
||||
|
@ -77,7 +77,10 @@ async def test_device_registry(hass, config_entry, config, soco):
|
||||
)
|
||||
assert reg_device.model == "Model Name"
|
||||
assert reg_device.sw_version == "13.1"
|
||||
assert reg_device.connections == {(dr.CONNECTION_NETWORK_MAC, "00:11:22:33:44:55")}
|
||||
assert reg_device.connections == {
|
||||
(dr.CONNECTION_NETWORK_MAC, "00:11:22:33:44:55"),
|
||||
(dr.CONNECTION_UPNP, "uuid:RINCON_test"),
|
||||
}
|
||||
assert reg_device.manufacturer == "Sonos"
|
||||
assert reg_device.suggested_area == "Zone A"
|
||||
assert reg_device.name == "Zone A"
|
||||
|
Loading…
x
Reference in New Issue
Block a user