diff --git a/homeassistant/components/jvc_projector/remote.py b/homeassistant/components/jvc_projector/remote.py index ecb2320fa3ce..f063fbd61ea0 100644 --- a/homeassistant/components/jvc_projector/remote.py +++ b/homeassistant/components/jvc_projector/remote.py @@ -15,6 +15,8 @@ from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from .coordinator import JVCConfigEntry from .entity import JvcProjectorEntity +POWER_SLEEP = 1 + COMMANDS: list[str] = [ cmd.Remote.MENU, cmd.Remote.UP, @@ -92,14 +94,14 @@ class JvcProjectorRemote(JvcProjectorEntity, RemoteEntity): async def async_turn_on(self, **kwargs: Any) -> None: """Turn the device on.""" await self.device.set(cmd.Power, cmd.Power.ON) - await asyncio.sleep(1) + await asyncio.sleep(POWER_SLEEP) await self.coordinator.async_refresh() @override async def async_turn_off(self, **kwargs: Any) -> None: """Turn the device off.""" await self.device.set(cmd.Power, cmd.Power.OFF) - await asyncio.sleep(1) + await asyncio.sleep(POWER_SLEEP) await self.coordinator.async_refresh() @override diff --git a/tests/components/jvc_projector/test_remote.py b/tests/components/jvc_projector/test_remote.py index 0ba2f18fe1ac..b70501ab79da 100644 --- a/tests/components/jvc_projector/test_remote.py +++ b/tests/components/jvc_projector/test_remote.py @@ -1,6 +1,6 @@ """Tests for JVC Projector remote platform.""" -from unittest.mock import MagicMock +from unittest.mock import MagicMock, patch import pytest @@ -31,6 +31,7 @@ async def test_entity_state( assert entity_registry.async_get(entity.entity_id) +@patch("homeassistant.components.jvc_projector.remote.POWER_SLEEP", 0) async def test_commands( hass: HomeAssistant, mock_device: MagicMock,