Use dataclass properties in songpal discovery (#60786)

This commit is contained in:
epenet 2021-12-01 20:46:10 +01:00 committed by GitHub
parent fbaec76b8a
commit 2b49694a4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,7 @@ class SongpalConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
friendly_name = discovery_info.upnp[ssdp.ATTR_UPNP_FRIENDLY_NAME]
parsed_url = urlparse(discovery_info.ssdp_location)
scalarweb_info = discovery_info["X_ScalarWebAPI_DeviceInfo"]
scalarweb_info = discovery_info.upnp["X_ScalarWebAPI_DeviceInfo"]
endpoint = scalarweb_info["X_ScalarWebAPI_BaseURL"]
service_types = scalarweb_info["X_ScalarWebAPI_ServiceList"][
"X_ScalarWebAPI_ServiceType"