Ignore UpnpXmlContentError in SamsungTV (#72056)
parent
12020ffac1
commit
8d57f70466
|
@ -15,6 +15,7 @@ from async_upnp_client.exceptions import (
|
|||
UpnpConnectionError,
|
||||
UpnpError,
|
||||
UpnpResponseError,
|
||||
UpnpXmlContentError,
|
||||
)
|
||||
from async_upnp_client.profiles.dlna import DmrDevice
|
||||
from async_upnp_client.utils import async_get_local_ip
|
||||
|
@ -270,11 +271,12 @@ class SamsungTVDevice(MediaPlayerEntity):
|
|||
# NETWORK,NONE
|
||||
upnp_factory = UpnpFactory(upnp_requester, non_strict=True)
|
||||
upnp_device: UpnpDevice | None = None
|
||||
with contextlib.suppress(UpnpConnectionError, UpnpResponseError):
|
||||
try:
|
||||
upnp_device = await upnp_factory.async_create_device(
|
||||
self._ssdp_rendering_control_location
|
||||
)
|
||||
if not upnp_device:
|
||||
except (UpnpConnectionError, UpnpResponseError, UpnpXmlContentError) as err:
|
||||
LOGGER.debug("Unable to create Upnp DMR device: %r", err, exc_info=True)
|
||||
return
|
||||
_, event_ip = await async_get_local_ip(
|
||||
self._ssdp_rendering_control_location, self.hass.loop
|
||||
|
|
|
@ -1368,6 +1368,7 @@ async def test_upnp_not_available(
|
|||
) -> None:
|
||||
"""Test for volume control when Upnp is not available."""
|
||||
await setup_samsungtv_entry(hass, MOCK_ENTRY_WS)
|
||||
assert "Unable to create Upnp DMR device" in caplog.text
|
||||
|
||||
# Upnp action fails
|
||||
assert await hass.services.async_call(
|
||||
|
@ -1385,6 +1386,7 @@ async def test_upnp_missing_service(
|
|||
) -> None:
|
||||
"""Test for volume control when Upnp is not available."""
|
||||
await setup_samsungtv_entry(hass, MOCK_ENTRY_WS)
|
||||
assert "Unable to create Upnp DMR device" in caplog.text
|
||||
|
||||
# Upnp action fails
|
||||
assert await hass.services.async_call(
|
||||
|
|
Loading…
Reference in New Issue