Skip to content

Commit

Permalink
Fixes blocking call in add_videos
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinfrlch committed Oct 22, 2024
1 parent fb28e2c commit cc5701d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/llmvision/media_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async def record_camera(image_entity, camera_number):
f"Fetched {image_entity} in {fetch_duration:.2f} seconds")

preprocessing_start_time = time.time()
img = Image.open(io.BytesIO(frame_data))
img = await self.hass.loop.run_in_executor(None, Image.open, io.BytesIO(frame_data))
current_frame_gray = np.array(img.convert('L'))

if previous_frame is not None:
Expand Down

0 comments on commit cc5701d

Please sign in to comment.