Add recordings timeline entry for frigate+ attributes (#8063)

* Add attribute item to timeline

* Add face icon

* Add support for other icons

* Cleanup

* Ensure attributes are only updated once

* don't show _ in attributes
This commit is contained in:
Nicolas Mowen
2023-10-07 08:17:18 -06:00
committed by GitHub
parent 79fabbb6b0
commit 08ef69bac4
6 changed files with 88 additions and 5 deletions

View File

@@ -74,6 +74,7 @@ class TimelineProcessor(threading.Thread):
camera_config.detect.height,
event_data["region"],
),
"attribute": "",
},
}
if event_type == "start":
@@ -93,6 +94,12 @@ class TimelineProcessor(threading.Thread):
"stationary" if event_data["stationary"] else "active"
)
Timeline.insert(timeline_entry).execute()
elif prev_event_data["attributes"] == {} and event_data["attributes"] != {}:
timeline_entry[Timeline.class_type] = "attribute"
timeline_entry[Timeline.data]["attribute"] = list(
event_data["attributes"].keys()
)[0]
Timeline.insert(timeline_entry).execute()
elif event_type == "end":
timeline_entry[Timeline.class_type] = "gone"
Timeline.insert(timeline_entry).execute()