From 4c41b47aad7541168b109a51594b14417bea3ce5 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 25 Mar 2026 08:46:00 -0600 Subject: [PATCH] Enable mypy for jobs and motion and fix motion types --- frigate/motion/__init__.py | 12 ++++++------ frigate/mypy.ini | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frigate/motion/__init__.py b/frigate/motion/__init__.py index 1f6785d5d..58f781f46 100644 --- a/frigate/motion/__init__.py +++ b/frigate/motion/__init__.py @@ -13,10 +13,10 @@ class MotionDetector(ABC): frame_shape: Tuple[int, int, int], config: MotionConfig, fps: int, - improve_contrast, - threshold, - contour_area, - ): + improve_contrast: bool, + threshold: int, + contour_area: int | None, + ) -> None: pass @abstractmethod @@ -25,7 +25,7 @@ class MotionDetector(ABC): pass @abstractmethod - def is_calibrating(self): + def is_calibrating(self) -> bool: """Return if motion is recalibrating.""" pass @@ -35,6 +35,6 @@ class MotionDetector(ABC): pass @abstractmethod - def stop(self): + def stop(self) -> None: """Stop any ongoing work and processes.""" pass diff --git a/frigate/mypy.ini b/frigate/mypy.ini index b29dea20d..0e36ba9e6 100644 --- a/frigate/mypy.ini +++ b/frigate/mypy.ini @@ -44,6 +44,12 @@ ignore_errors = false [mypy-frigate.genai] ignore_errors = false +[mypy-frigate.jobs] +ignore_errors = false + +[mypy-frigate.motion] +ignore_errors = false + [mypy-frigate.log] ignore_errors = false