mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix Canary doing I/O in event loop (#44854)
This commit is contained in:
parent
35edc40537
commit
34161f3ff6
@ -127,11 +127,14 @@ class CanaryCamera(CoordinatorEntity, Camera):
|
|||||||
async def async_camera_image(self):
|
async def async_camera_image(self):
|
||||||
"""Return a still image response from the camera."""
|
"""Return a still image response from the camera."""
|
||||||
await self.hass.async_add_executor_job(self.renew_live_stream_session)
|
await self.hass.async_add_executor_job(self.renew_live_stream_session)
|
||||||
|
live_stream_url = await self.hass.async_add_executor_job(
|
||||||
|
getattr, self._live_stream_session, "live_stream_url"
|
||||||
|
)
|
||||||
|
|
||||||
ffmpeg = ImageFrame(self._ffmpeg.binary)
|
ffmpeg = ImageFrame(self._ffmpeg.binary)
|
||||||
image = await asyncio.shield(
|
image = await asyncio.shield(
|
||||||
ffmpeg.get_image(
|
ffmpeg.get_image(
|
||||||
self._live_stream_session.live_stream_url,
|
live_stream_url,
|
||||||
output_format=IMAGE_JPEG,
|
output_format=IMAGE_JPEG,
|
||||||
extra_cmd=self._ffmpeg_arguments,
|
extra_cmd=self._ffmpeg_arguments,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user