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", "documentation": "https://www.home-assistant.io/integrations/denonavr",
"iot_class": "local_push", "iot_class": "local_push",
"loggers": ["denonavr"], "loggers": ["denonavr"],
"requirements": ["denonavr==0.11.4"], "requirements": ["denonavr==0.11.6"],
"ssdp": [ "ssdp": [
{ {
"manufacturer": "Denon", "manufacturer": "Denon",

View file

@ -21,6 +21,7 @@ from denonavr.exceptions import (
AvrCommandError, AvrCommandError,
AvrForbiddenError, AvrForbiddenError,
AvrNetworkError, AvrNetworkError,
AvrProcessingError,
AvrTimoutError, AvrTimoutError,
DenonAvrError, DenonAvrError,
) )
@ -201,6 +202,16 @@ def async_log_errors(
self._receiver.host, self._receiver.host,
) )
self._attr_available = False 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: except AvrForbiddenError:
available = False available = False
if self.available: if self.available:
@ -274,8 +285,6 @@ class DenonDevice(MediaPlayerEntity):
and MediaPlayerEntityFeature.SELECT_SOUND_MODE and MediaPlayerEntityFeature.SELECT_SOUND_MODE
) )
self._telnet_was_healthy: bool | None = None
async def _telnet_callback(self, zone: str, event: str, parameter: str) -> None: async def _telnet_callback(self, zone: str, event: str, parameter: str) -> None:
"""Process a telnet command callback.""" """Process a telnet command callback."""
# There are multiple checks implemented which reduce unnecessary updates of the ha state machine # 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.""" """Get the latest status information from device."""
receiver = self._receiver receiver = self._receiver
# We can only skip the update if telnet was healthy after # We skip the update if telnet is healthy.
# the last update and is still healthy now to ensure that # When telnet recovers it automatically updates all properties.
# we don't miss any state changes while telnet is down if receiver.telnet_connected and receiver.telnet_healthy:
# or reconnecting.
if (
telnet_is_healthy := receiver.telnet_connected and receiver.telnet_healthy
) and self._telnet_was_healthy:
return 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() await receiver.async_update()
self._telnet_was_healthy = telnet_is_healthy
if self._update_audyssey: if self._update_audyssey:
await receiver.async_update_audyssey() await receiver.async_update_audyssey()

View file

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

View file

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