From d27e8c1bbf53cd952dd9f4617bc8ee02c00c6719 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 19 Aug 2025 07:07:24 -0500 Subject: [PATCH] run autotracking setup method in asyncio coroutine (#19614) --- frigate/ptz/autotrack.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frigate/ptz/autotrack.py b/frigate/ptz/autotrack.py index f38bf1f5f..662ce63d3 100644 --- a/frigate/ptz/autotrack.py +++ b/frigate/ptz/autotrack.py @@ -1329,7 +1329,11 @@ class PtzAutoTracker: if camera_config.onvif.autotracking.enabled: if not self.autotracker_init[camera]: - self._autotracker_setup(camera_config, camera) + future = asyncio.run_coroutine_threadsafe( + self._autotracker_setup(camera_config, camera), self.onvif.loop + ) + # Wait for the coroutine to complete + future.result() if self.calibrating[camera]: logger.debug(f"{camera}: Calibrating camera")