Use pre capture for custom events (#7038)

* Use pre capture for custom events

* Formatting
This commit is contained in:
Nicolas Mowen 2023-07-06 06:26:53 -06:00 committed by GitHub
parent 998bffe706
commit 0f68fbc8db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,8 +57,12 @@ class ExternalEventProcessor:
"label": label,
"sub_label": sub_label,
"camera": camera,
"start_time": now,
"end_time": now + duration if duration is not None else None,
"start_time": now - camera_config.record.events.pre_capture,
"end_time": now
+ duration
+ camera_config.record.events.post_capture
if duration is not None
else None,
"thumbnail": thumbnail,
"has_clip": camera_config.record.enabled and include_recording,
"has_snapshot": True,