mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-11 21:31:12 +03:00
guard autotracker_init lookups for cameras enabled at runtime
This commit is contained in:
@@ -111,9 +111,9 @@ class CameraState:
|
||||
# draw thicker box around ptz autotracked object
|
||||
if (
|
||||
self.camera_config.onvif.autotracking.enabled
|
||||
and self.ptz_autotracker_thread.ptz_autotracker.autotracker_init[
|
||||
and self.ptz_autotracker_thread.ptz_autotracker.autotracker_init.get(
|
||||
self.name
|
||||
]
|
||||
)
|
||||
and self.ptz_autotracker_thread.ptz_autotracker.tracked_object[
|
||||
self.name
|
||||
]
|
||||
|
||||
@@ -1365,7 +1365,7 @@ class PtzAutoTracker:
|
||||
camera_config = self.config.cameras[camera]
|
||||
|
||||
if camera_config.onvif.autotracking.enabled:
|
||||
if not self.autotracker_init[camera]:
|
||||
if not self.autotracker_init.get(camera):
|
||||
future = asyncio.run_coroutine_threadsafe(
|
||||
self._autotracker_setup(camera_config, camera), self.onvif.loop
|
||||
)
|
||||
@@ -1483,9 +1483,11 @@ class PtzAutoTracker:
|
||||
}
|
||||
|
||||
async def camera_maintenance(self, camera):
|
||||
# bail and don't check anything if we're calibrating or tracking an object
|
||||
# bail and don't check anything if we're not set up yet, calibrating, or
|
||||
# tracking an object. a camera enabled at runtime has no autotracker_init
|
||||
# entry until autotrack_object sets it up
|
||||
if (
|
||||
not self.autotracker_init[camera]
|
||||
not self.autotracker_init.get(camera)
|
||||
or self.calibrating[camera]
|
||||
or self.tracked_object[camera] is not None
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user