From 62047c80d569fc33c060f265c701c0fcd2cce819 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:17:01 -0500 Subject: [PATCH] Poll for camera status on tracking end instead of waiting (#19879) --- frigate/ptz/autotrack.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frigate/ptz/autotrack.py b/frigate/ptz/autotrack.py index a75ea13ae..c6d43bbba 100644 --- a/frigate/ptz/autotrack.py +++ b/frigate/ptz/autotrack.py @@ -1462,7 +1462,7 @@ class PtzAutoTracker: if not self.autotracker_init[camera]: self._autotracker_setup(self.config.cameras[camera], camera) # regularly update camera status - while not self.ptz_metrics[camera].motor_stopped.is_set(): + if not self.ptz_metrics[camera].motor_stopped.is_set(): await self.onvif.get_camera_status(camera) # return to preset if tracking is over @@ -1481,7 +1481,8 @@ class PtzAutoTracker: self.tracked_object[camera] = None self.tracked_object_history[camera].clear() - self.ptz_metrics[camera].motor_stopped.wait() + while not self.ptz_metrics[camera].motor_stopped.is_set(): + await self.onvif.get_camera_status(camera) logger.debug( f"{camera}: Time is {self.ptz_metrics[camera].frame_time.value}, returning to preset: {autotracker_config.return_preset}" )