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:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user