Suppress Upnp parsing errors in SamsungTV (#69664)

pull/69835/head
epenet 2022-04-08 15:36:43 +02:00 committed by Paulus Schoutsen
parent b1eda25ca3
commit 269405aee0
1 changed files with 4 additions and 1 deletions

View File

@ -279,7 +279,10 @@ class SamsungTVDevice(MediaPlayerEntity):
if self._dmr_device is None:
session = async_get_clientsession(self.hass)
upnp_requester = AiohttpSessionRequester(session)
upnp_factory = UpnpFactory(upnp_requester)
# Set non_strict to avoid invalid data sent by Samsung TV:
# Got invalid value for <UpnpStateVariable(PlaybackStorageMedium, string)>:
# NETWORK,NONE
upnp_factory = UpnpFactory(upnp_requester, non_strict=True)
upnp_device: UpnpDevice | None = None
with contextlib.suppress(UpnpConnectionError):
upnp_device = await upnp_factory.async_create_device(