Log gathered exceptions during Sonos unsubscriptions (#54190)
parent
e558b3463e
commit
87e0b14282
|
@ -187,8 +187,7 @@ class SonosDiscoveryManager:
|
|||
|
||||
async def _async_stop_event_listener(self, event: Event | None = None) -> None:
|
||||
await asyncio.gather(
|
||||
*(speaker.async_unsubscribe() for speaker in self.data.discovered.values()),
|
||||
return_exceptions=True,
|
||||
*(speaker.async_unsubscribe() for speaker in self.data.discovered.values())
|
||||
)
|
||||
if events_asyncio.event_listener:
|
||||
await events_asyncio.event_listener.async_stop()
|
||||
|
|
|
@ -346,10 +346,13 @@ class SonosSpeaker:
|
|||
async def async_unsubscribe(self) -> None:
|
||||
"""Cancel all subscriptions."""
|
||||
_LOGGER.debug("Unsubscribing from events for %s", self.zone_name)
|
||||
await asyncio.gather(
|
||||
results = await asyncio.gather(
|
||||
*(subscription.unsubscribe() for subscription in self._subscriptions),
|
||||
return_exceptions=True,
|
||||
)
|
||||
for result in results:
|
||||
if isinstance(result, Exception):
|
||||
_LOGGER.debug("Unsubscribe failed for %s: %s", self.zone_name, result)
|
||||
self._subscriptions = []
|
||||
|
||||
@callback
|
||||
|
|
Loading…
Reference in New Issue