From f7c3ddd38090451d7cc44b95b5022c83eeeca02c Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 28 May 2024 12:33:28 -0500 Subject: [PATCH] check if motion dataframe is empty (#11593) --- frigate/api/review.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frigate/api/review.py b/frigate/api/review.py index 855122989..e730573cf 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