mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Remove passing loop into sleep in SamsungTV (#66030)
This commit is contained in:
parent
721d711762
commit
4732e37005
@ -245,7 +245,7 @@ class SamsungTVDevice(MediaPlayerEntity):
|
|||||||
|
|
||||||
for digit in media_id:
|
for digit in media_id:
|
||||||
await self.hass.async_add_executor_job(self.send_key, f"KEY_{digit}")
|
await self.hass.async_add_executor_job(self.send_key, f"KEY_{digit}")
|
||||||
await asyncio.sleep(KEY_PRESS_TIMEOUT, self.hass.loop)
|
await asyncio.sleep(KEY_PRESS_TIMEOUT)
|
||||||
await self.hass.async_add_executor_job(self.send_key, "KEY_ENTER")
|
await self.hass.async_add_executor_job(self.send_key, "KEY_ENTER")
|
||||||
|
|
||||||
def _wake_on_lan(self) -> None:
|
def _wake_on_lan(self) -> None:
|
||||||
|
@ -713,9 +713,9 @@ async def test_play_media(hass, remote):
|
|||||||
asyncio_sleep = asyncio.sleep
|
asyncio_sleep = asyncio.sleep
|
||||||
sleeps = []
|
sleeps = []
|
||||||
|
|
||||||
async def sleep(duration, loop):
|
async def sleep(duration):
|
||||||
sleeps.append(duration)
|
sleeps.append(duration)
|
||||||
await asyncio_sleep(0, loop=loop)
|
await asyncio_sleep(0)
|
||||||
|
|
||||||
await setup_samsungtv(hass, MOCK_CONFIG)
|
await setup_samsungtv(hass, MOCK_CONFIG)
|
||||||
with patch("asyncio.sleep", new=sleep):
|
with patch("asyncio.sleep", new=sleep):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user