mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	check if motion dataframe is empty (#11593)
This commit is contained in:
		
							parent
							
								
									8546d3d315
								
							
						
					
					
						commit
						f7c3ddd380
					
				| @ -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 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user