feat: Add support for Frigate reviews / detections [initial PR] (#2315)

- Add support for Frigate reviews / detections.
 - Add support for GenAI metadata.
- Significant internal refactor to more flexible "UnifiedQuery" to allow
mixing cameras with simple metadata and review metadata (e.g. a timeline
view of a Frigate camera with reviews, and a Reolink camera with simple
metadata).
 - Add support for folder media as camera media.

There are a few more PRs to commit prior to this going live, but
commiting this for now due to the scale of the change.

BREAKING CHANGE: `media_type` and `events_type` are retired under
`live`, `viewer` and `timeline` configuration sections, instead media
type is associated (once) with the camera under `media`.
This commit is contained in:
Dermot Duffy
2026-01-19 13:32:50 -08:00
committed by GitHub
parent 6eb0a87ca8
commit fc32727860
215 changed files with 14491 additions and 6160 deletions
+105 -1
View File
@@ -1512,10 +1512,17 @@ describe('should handle version specific upgrades', () => {
expect(config).toEqual({
type: 'custom:advanced-camera-card',
cameras: [{}],
...(mediaEventType !== 'all' && {
cameras_global: {
media: {
events_type: mediaEventType,
},
},
}),
live: {
controls: {
thumbnails: {
events_media_type: mediaEventType,
// v8.0.0+ migration moves events_media_type to cameras_global .
},
},
},
@@ -3587,4 +3594,101 @@ describe('should handle version specific upgrades', () => {
postUpgradeChecks(config);
});
});
describe('v8.0.0+', () => {
describe('live.controls.thumbnails.media_type -> cameras_global.media.type', () => {
it.each([['events' as const], ['recordings' as const]])(
'%s',
(mediaType: string) => {
const config = {
type: 'custom:advanced-camera-card',
cameras: [{}],
live: {
controls: {
thumbnails: {
media_type: mediaType,
},
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
type: 'custom:advanced-camera-card',
cameras: [{}],
live: {
controls: {
thumbnails: {},
},
},
cameras_global: {
media: {
type: mediaType,
},
},
});
postUpgradeChecks(config);
},
);
});
describe('live.controls.thumbnails.events_media_type -> cameras_global.media.events_type', () => {
it.each([['clips' as const], ['snapshots' as const]])(
'%s',
(eventsType: string) => {
const config = {
type: 'custom:advanced-camera-card',
cameras: [{}],
live: {
controls: {
thumbnails: {
events_media_type: eventsType,
},
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
type: 'custom:advanced-camera-card',
cameras: [{}],
live: {
controls: {
thumbnails: {},
},
},
cameras_global: {
media: {
events_type: eventsType,
},
},
});
postUpgradeChecks(config);
},
);
it('all', () => {
const config = {
type: 'custom:advanced-camera-card',
cameras: [{}],
live: {
controls: {
thumbnails: {
events_media_type: 'all',
},
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
type: 'custom:advanced-camera-card',
cameras: [{}],
live: {
controls: {
thumbnails: {},
},
},
});
postUpgradeChecks(config);
});
});
});
});
+39 -16
View File
@@ -53,10 +53,14 @@ describe('config defaults', () => {
media_resolution: 'low',
},
triggers: {
events: ['events', 'clips', 'snapshots'],
events: [],
entities: [],
motion: false,
occupancy: false,
reviews: {
severities: ['high'],
description: true,
},
},
},
debug: {
@@ -92,18 +96,17 @@ describe('config defaults', () => {
position: 'bottom-right',
},
thumbnails: {
media_type: 'events',
events_media_type: 'all',
mode: 'right',
show_details: true,
show_download_control: true,
show_download_control: false,
show_favorite_control: true,
show_timeline_control: true,
show_info_control: true,
show_review_control: true,
show_timeline_control: false,
size: 100,
},
timeline: {
clustering_threshold: 3,
events_media_type: 'all',
format: {
'24h': true,
},
@@ -135,9 +138,11 @@ describe('config defaults', () => {
},
thumbnails: {
show_details: false,
show_download_control: true,
show_download_control: false,
show_favorite_control: true,
show_timeline_control: true,
show_info_control: true,
show_review_control: true,
show_timeline_control: false,
size: 100,
},
},
@@ -164,14 +169,15 @@ describe('config defaults', () => {
thumbnails: {
mode: 'right',
show_details: true,
show_download_control: true,
show_download_control: false,
show_favorite_control: true,
show_timeline_control: true,
show_info_control: true,
show_review_control: true,
show_timeline_control: false,
size: 100,
},
timeline: {
clustering_threshold: 3,
events_media_type: 'all',
format: {
'24h': true,
},
@@ -202,7 +208,7 @@ describe('config defaults', () => {
priority: 50,
},
clips: {
enabled: true,
enabled: false,
priority: 50,
},
display_mode: {
@@ -229,6 +235,10 @@ describe('config defaults', () => {
enabled: false,
priority: 50,
},
info: {
enabled: true,
priority: 50,
},
iris: {
enabled: true,
priority: 50,
@@ -266,12 +276,20 @@ describe('config defaults', () => {
enabled: false,
priority: 50,
},
reviews: {
enabled: true,
priority: 50,
},
set_review: {
enabled: true,
priority: 50,
},
screenshot: {
enabled: false,
priority: 50,
},
snapshots: {
enabled: true,
enabled: false,
priority: 50,
},
substreams: {
@@ -314,6 +332,10 @@ describe('config defaults', () => {
enabled: true,
priority: 50,
},
severity: {
enabled: true,
priority: 50,
},
technology: {
enabled: true,
priority: 50,
@@ -333,13 +355,14 @@ describe('config defaults', () => {
thumbnails: {
mode: 'right',
show_details: true,
show_download_control: true,
show_download_control: false,
show_favorite_control: true,
show_timeline_control: true,
show_info_control: true,
show_review_control: true,
show_timeline_control: false,
size: 100,
},
},
events_media_type: 'all',
format: {
'24h': true,
},