Update denonavr to 0.11.6 (#110231)

* Update `denonavr` to `0.11.5`

* Handle `AvrProcessingError` exception

* Remove obsolete `_telnet_was_healthy` property from receiver

* Update `denonavr` to `0.11.6`
This commit is contained in:
Oliver 2024-02-11 08:29:40 +01:00 committed by GitHub
parent 2f7d71347e
commit 0c9f9486bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 19 deletions

View file

@ -6,7 +6,7 @@
"documentation": "https://www.home-assistant.io/integrations/denonavr",
"iot_class": "local_push",
"loggers": ["denonavr"],
"requirements": ["denonavr==0.11.4"],
"requirements": ["denonavr==0.11.6"],
"ssdp": [
{
"manufacturer": "Denon",

View file

@ -21,6 +21,7 @@ from denonavr.exceptions import (
AvrCommandError,
AvrForbiddenError,
AvrNetworkError,
AvrProcessingError,
AvrTimoutError,
DenonAvrError,
)
@ -201,6 +202,16 @@ def async_log_errors(
self._receiver.host,
)
self._attr_available = False
except AvrProcessingError:
available = True
if self.available:
_LOGGER.warning(
(
"Update of Denon AVR receiver at host %s not complete. "
"Device is still available"
),
self._receiver.host,
)
except AvrForbiddenError:
available = False
if self.available:
@ -274,8 +285,6 @@ class DenonDevice(MediaPlayerEntity):
and MediaPlayerEntityFeature.SELECT_SOUND_MODE
)
self._telnet_was_healthy: bool | None = None
async def _telnet_callback(self, zone: str, event: str, parameter: str) -> None:
"""Process a telnet command callback."""
# There are multiple checks implemented which reduce unnecessary updates of the ha state machine
@ -306,24 +315,13 @@ class DenonDevice(MediaPlayerEntity):
"""Get the latest status information from device."""
receiver = self._receiver
# We can only skip the update if telnet was healthy after
# the last update and is still healthy now to ensure that
# we don't miss any state changes while telnet is down
# or reconnecting.
if (
telnet_is_healthy := receiver.telnet_connected and receiver.telnet_healthy
) and self._telnet_was_healthy:
# We skip the update if telnet is healthy.
# When telnet recovers it automatically updates all properties.
if receiver.telnet_connected and receiver.telnet_healthy:
return
# if async_update raises an exception, we don't want to skip the next update
# so we set _telnet_was_healthy to None here and only set it to the value
# before the update if the update was successful
self._telnet_was_healthy = None
await receiver.async_update()
self._telnet_was_healthy = telnet_is_healthy
if self._update_audyssey:
await receiver.async_update_audyssey()

View file

@ -704,7 +704,7 @@ deluge-client==1.7.1
demetriek==0.4.0
# homeassistant.components.denonavr
denonavr==0.11.4
denonavr==0.11.6
# homeassistant.components.devialet
devialet==1.4.5

View file

@ -579,7 +579,7 @@ deluge-client==1.7.1
demetriek==0.4.0
# homeassistant.components.denonavr
denonavr==0.11.4
denonavr==0.11.6
# homeassistant.components.devialet
devialet==1.4.5