Handle failed Sonos subscriptions better (#87240)

Catch unsubscribe failure separately from ZGS poll
pull/87246/head
jjlawren 2023-02-02 22:42:36 -06:00 committed by GitHub
parent 2c0c386ba7
commit a8b7a32578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import socket
from typing import TYPE_CHECKING, Any, cast
from urllib.parse import urlparse
from aiohttp import ClientError
from requests.exceptions import Timeout
from soco import events_asyncio, zonegroupstate
import soco.config as soco_config
@ -229,6 +230,10 @@ class SonosDiscoveryManager:
)
try:
await sub.unsubscribe()
except (ClientError, OSError, Timeout) as ex:
_LOGGER.debug("Unsubscription from %s failed: %s", ip_address, ex)
try:
await self.hass.async_add_executor_job(soco.zone_group_state.poll, soco)
except (OSError, SoCoException, Timeout) as ex:
_LOGGER.warning(