Normal Frigate Event API
This commit is contained in:
		
							
								
								
									
										4
									
								
								log.py
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								log.py
									
									
									
									
									
								
							| @ -126,7 +126,7 @@ def handle_event(event_id): | ||||
|         logging.warning(f"No cached info found for event ID: {event_id} on handle_event") | ||||
|         return | ||||
|  | ||||
|     clip_url = f"{HOMEASSISTANT_URL}/api/frigate/notifications/{event_id}/{event_info['camera']}/clip.mp4" | ||||
|     clip_url = f"{HOMEASSISTANT_URL}/api/events/{event_id}/snapshot.jpg" | ||||
|     email_message = f"A {event_info['event_label']} was detected on camera {event_info['camera']}.\nEvent ID: {event_id}" | ||||
|  | ||||
|     send_email(email_message, event_info['snapshot_urls'], event_info['event_label'], clip_url) | ||||
| @ -162,7 +162,7 @@ def on_message(client, userdata, message): | ||||
|             logging.info(f"Event from camera '{camera}' with label '{event_label}' and zones '{zones}' blocked by alert rules.") | ||||
|             return | ||||
|  | ||||
|         snapshot_url = f"{HOMEASSISTANT_IP}/api/frigate/notifications/{event_id}/snapshot.jpg" | ||||
|         snapshot_url = f"{HOMEASSISTANT_IP}/api/events/{event_id}/snapshot.jpg" | ||||
|  | ||||
|         if event_id in event_cache: | ||||
|             event_cache[event_id]['snapshot_urls'].append(snapshot_url) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user