Suppress Upnp parsing errors in SamsungTV (#69664)

This commit is contained in:
epenet 2022-04-08 15:36:43 +02:00 committed by GitHub
parent 5076437413
commit 2ad096733a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,7 +263,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(