run autotracking setup method in asyncio coroutine (#19614)

This commit is contained in:
Josh Hawkins 2025-08-19 07:07:24 -05:00 committed by GitHub
parent 353ee1228c
commit d27e8c1bbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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")