From 39d923dc0273e1728d01e36bf15d2be0d60a86c6 Mon Sep 17 00:00:00 2001 From: Steve Easley Date: Mon, 29 Apr 2024 12:25:16 -0400 Subject: [PATCH] Fix jvcprojector command timeout with some projectors (#116392) * Fix projector timeout in pyprojector lib v1.0.10 * Fix projector timeout by increasing time between power command and refresh. * Bump jvcprojector lib to ensure unknown power states are handled --- homeassistant/components/jvc_projector/manifest.json | 2 +- homeassistant/components/jvc_projector/remote.py | 3 +++ requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/jvc_projector/manifest.json b/homeassistant/components/jvc_projector/manifest.json index de7e77197f2..d3e1bf3d940 100644 --- a/homeassistant/components/jvc_projector/manifest.json +++ b/homeassistant/components/jvc_projector/manifest.json @@ -7,5 +7,5 @@ "integration_type": "device", "iot_class": "local_polling", "loggers": ["jvcprojector"], - "requirements": ["pyjvcprojector==1.0.9"] + "requirements": ["pyjvcprojector==1.0.11"] } diff --git a/homeassistant/components/jvc_projector/remote.py b/homeassistant/components/jvc_projector/remote.py index dcc9e5cff51..b69d3b0118b 100644 --- a/homeassistant/components/jvc_projector/remote.py +++ b/homeassistant/components/jvc_projector/remote.py @@ -2,6 +2,7 @@ from __future__ import annotations +import asyncio from collections.abc import Iterable import logging from typing import Any @@ -74,11 +75,13 @@ class JvcProjectorRemote(JvcProjectorEntity, RemoteEntity): async def async_turn_on(self, **kwargs: Any) -> None: """Turn the device on.""" await self.device.power_on() + await asyncio.sleep(1) await self.coordinator.async_refresh() async def async_turn_off(self, **kwargs: Any) -> None: """Turn the device off.""" await self.device.power_off() + await asyncio.sleep(1) await self.coordinator.async_refresh() async def async_send_command(self, command: Iterable[str], **kwargs: Any) -> None: diff --git a/requirements_all.txt b/requirements_all.txt index 6e41f3b743e..1f83f00bb53 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1902,7 +1902,7 @@ pyisy==3.1.14 pyitachip2ir==0.0.7 # homeassistant.components.jvc_projector -pyjvcprojector==1.0.9 +pyjvcprojector==1.0.11 # homeassistant.components.kaleidescape pykaleidescape==1.0.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index a2625b50e87..060287d637a 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1483,7 +1483,7 @@ pyiss==1.0.1 pyisy==3.1.14 # homeassistant.components.jvc_projector -pyjvcprojector==1.0.9 +pyjvcprojector==1.0.11 # homeassistant.components.kaleidescape pykaleidescape==1.0.1