From e357715a8c908e70c50bd472aded8f39d5378bb5 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 19 May 2023 04:16:11 -0600 Subject: [PATCH] Ability to manually create events through the API (#3184) * Move to events package * Improve handling of external events * Handle external events in the event queue * Pass in event processor * Check event json * Fix json parsing and change defaults * Fix snapshot saving * Hide % score when not available * Correct docs and add json example * Save event png db * Adjust image * Formatting * Add catch for failure ending event * Add init to modules * Fix naming * Formatting * Fix http creation * fix test * Change to PUT and include response in docs * Add ability to set bounding box locations in snapshot * Support multiple box annotations * Cleanup docs example response Co-authored-by: Blake Blackshear * Cleanup docs wording Co-authored-by: Blake Blackshear * Store full frame for thumbnail * Formatting * Set thumbnail height to 175 * Formatting --------- Co-authored-by: Blake Blackshear --- docs/docs/integrations/api.md | 38 ++++ frigate/app.py | 11 +- frigate/events/__init__.py | 0 frigate/events/cleanup.py | 176 ++++++++++++++++++ frigate/events/external.py | 132 ++++++++++++++ frigate/{events.py => events/maintainer.py} | 190 ++++---------------- frigate/http.py | 81 +++++++-- frigate/object_processing.py | 2 +- frigate/record/__init__.py | 0 frigate/test/test_http.py | 10 ++ frigate/timeline.py | 2 +- web/src/routes/Events.jsx | 4 +- 12 files changed, 466 insertions(+), 180 deletions(-) create mode 100644 frigate/events/__init__.py create mode 100644 frigate/events/cleanup.py create mode 100644 frigate/events/external.py rename frigate/{events.py => events/maintainer.py} (51%) create mode 100644 frigate/record/__init__.py diff --git a/docs/docs/integrations/api.md b/docs/docs/integrations/api.md index b5b80f3ea..3e5fdfe3e 100644 --- a/docs/docs/integrations/api.md +++ b/docs/docs/integrations/api.md @@ -295,3 +295,41 @@ Get ffprobe output for camera feed paths. ### `GET /api//ptz/info` Get PTZ info for the camera. + +### `POST /api/events//