Simplify SSDP discovery in SamsungTV (#67843)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/67847/head
epenet 2022-03-08 08:54:03 +01:00 committed by GitHub
parent 56abd5f2cf
commit 6da38d67ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -285,10 +285,11 @@ class SamsungTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
self._host = hostname
self._manufacturer = discovery_info.upnp[ssdp.ATTR_UPNP_MANUFACTURER]
self._abort_if_manufacturer_is_not_samsung()
if not await self._async_get_and_check_device_info():
# If we cannot get device info for an SSDP discovery
# its likely a legacy tv.
self._name = self._title = self._model = model_name
# Set defaults, in case they cannot be extracted from device_info
self._name = self._title = self._model = model_name
# Update from device_info (if accessible)
await self._async_get_and_check_device_info()
# The UDN provided by the ssdp discovery doesn't always match the UDN
# from the device_info, used by the the other methods so we need to