Use dataclass properties in synology_dsm discovery (#60740)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/60814/head
epenet 2021-12-01 18:04:00 +01:00 committed by GitHub
parent aefd89d8f2
commit 0c89c8a6b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -239,12 +239,12 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN):
async def async_step_ssdp(self, discovery_info: ssdp.SsdpServiceInfo) -> FlowResult:
"""Handle a discovered synology_dsm."""
parsed_url = urlparse(discovery_info[ssdp.ATTR_SSDP_LOCATION])
parsed_url = urlparse(discovery_info.ssdp_location)
friendly_name = (
discovery_info[ssdp.ATTR_UPNP_FRIENDLY_NAME].split("(", 1)[0].strip()
discovery_info.upnp[ssdp.ATTR_UPNP_FRIENDLY_NAME].split("(", 1)[0].strip()
)
discovered_mac = discovery_info[ssdp.ATTR_UPNP_SERIAL].upper()
discovered_mac = discovery_info.upnp[ssdp.ATTR_UPNP_SERIAL].upper()
# Synology NAS can broadcast on multiple IP addresses, since they can be connected to multiple ethernets.
# The serial of the NAS is actually its MAC address.