Fix initialization of some denonavr receivers when telnet API is enabled (#127882)

Suppress `denonavr.exceptions.AvrProcessingError` when connecting to telnet API
This commit is contained in:
Oliver 2024-10-14 23:23:44 +02:00 committed by GitHub
parent 11e8e56e05
commit df52f3f0e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,9 +3,11 @@
from __future__ import annotations from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable
import contextlib
import logging import logging
from denonavr import DenonAVR from denonavr import DenonAVR
from denonavr.exceptions import AvrProcessingError
import httpx import httpx
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -94,7 +96,8 @@ class ConnectDenonAVR:
# Do an initial update if telnet is used. # Do an initial update if telnet is used.
if self._use_telnet: if self._use_telnet:
for zone in receiver.zones.values(): for zone in receiver.zones.values():
await zone.async_update() with contextlib.suppress(AvrProcessingError):
await zone.async_update()
if self._update_audyssey: if self._update_audyssey:
await zone.async_update_audyssey() await zone.async_update_audyssey()
await receiver.async_telnet_connect() await receiver.async_telnet_connect()