Skip to content

NVR with realtime local object detection for IP cameras

check if motion dataframe is empty (#11593)

Josh Hawkinsf7c3ddd38090
diff --git a/frigate/api/review.py b/frigate/api/review.py
index 855122989e..e730573cfb 100644
--- a/frigate/api/review.py
+++ b/frigate/api/review.py
@@ -440,6 +440,11 @@ def motion_activity():
# resample data using pandas to get activity on scaled basis
df = pd.DataFrame(data, columns=["start_time", "motion", "camera"])
+
+ if df.empty:
+ logger.warning("No motion data found for the requested time range")
+ return jsonify([])
+
df = df.astype(dtype={"motion": "float16"})
# set date as datetime index