Update media state via telnet in `denonavr` integration (#89788)
parent
87264d219a
commit
0441a64c69
|
@ -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.1"],
|
"requirements": ["denonavr==0.11.2"],
|
||||||
"ssdp": [
|
"ssdp": [
|
||||||
{
|
{
|
||||||
"manufacturer": "Denon",
|
"manufacturer": "Denon",
|
||||||
|
|
|
@ -249,11 +249,19 @@ class DenonDevice(MediaPlayerEntity):
|
||||||
|
|
||||||
self._telnet_was_healthy: bool | None = None
|
self._telnet_was_healthy: bool | None = None
|
||||||
|
|
||||||
async def _telnet_callback(self, zone, event, parameter):
|
async def _telnet_callback(self, zone, event, parameter) -> 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
|
||||||
if zone != self._receiver.zone:
|
if zone != self._receiver.zone:
|
||||||
return
|
return
|
||||||
|
# Some updates trigger multiple events like one for artist and one for title for one change
|
||||||
|
# We skip every event except the last one
|
||||||
|
if event == "NS" and not parameter.startswith("E4"):
|
||||||
|
return
|
||||||
|
if event == "TA" and not parameter.startwith("ANNAME"):
|
||||||
|
return
|
||||||
|
if event == "HD" and not parameter.startswith("ALBUM"):
|
||||||
|
return
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
|
@ -276,7 +284,6 @@ class DenonDevice(MediaPlayerEntity):
|
||||||
if (
|
if (
|
||||||
telnet_is_healthy := receiver.telnet_connected and receiver.telnet_healthy
|
telnet_is_healthy := receiver.telnet_connected and receiver.telnet_healthy
|
||||||
) and self._telnet_was_healthy:
|
) and self._telnet_was_healthy:
|
||||||
await receiver.input.async_update_media_state()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# if async_update raises an exception, we don't want to skip the next update
|
# if async_update raises an exception, we don't want to skip the next update
|
||||||
|
|
|
@ -586,7 +586,7 @@ deluge-client==1.7.1
|
||||||
demetriek==0.4.0
|
demetriek==0.4.0
|
||||||
|
|
||||||
# homeassistant.components.denonavr
|
# homeassistant.components.denonavr
|
||||||
denonavr==0.11.1
|
denonavr==0.11.2
|
||||||
|
|
||||||
# homeassistant.components.devolo_home_control
|
# homeassistant.components.devolo_home_control
|
||||||
devolo-home-control-api==0.18.2
|
devolo-home-control-api==0.18.2
|
||||||
|
|
|
@ -466,7 +466,7 @@ deluge-client==1.7.1
|
||||||
demetriek==0.4.0
|
demetriek==0.4.0
|
||||||
|
|
||||||
# homeassistant.components.denonavr
|
# homeassistant.components.denonavr
|
||||||
denonavr==0.11.1
|
denonavr==0.11.2
|
||||||
|
|
||||||
# homeassistant.components.devolo_home_control
|
# homeassistant.components.devolo_home_control
|
||||||
devolo-home-control-api==0.18.2
|
devolo-home-control-api==0.18.2
|
||||||
|
|
Loading…
Reference in New Issue