Add error handling for camera manager calls.

This commit is contained in:
Dermot Duffy
2023-01-24 19:36:54 -08:00
parent e85d46d84a
commit 54f63d0cf3
9 changed files with 118 additions and 74 deletions
+8 -1
View File
@@ -471,6 +471,7 @@ export class FrigateCardTimelineCore extends LitElement {
['background', 'group-label'].includes(properties.what)
) {
view = await createViewForRecordings(
this,
this.hass,
this.cameraManager,
this.cameras,
@@ -487,6 +488,7 @@ export class FrigateCardTimelineCore extends LitElement {
);
} else if (this.timelineConfig?.show_recordings && properties.what === 'axis') {
view = await createViewForRecordings(
this,
this.hass,
this.cameraManager,
this.cameras,
@@ -641,6 +643,7 @@ export class FrigateCardTimelineCore extends LitElement {
return null;
}
const view = await createViewForEvents(
this,
this.hass,
this.cameraManager,
this.cameras,
@@ -651,6 +654,9 @@ export class FrigateCardTimelineCore extends LitElement {
mediaType: this.timelineConfig?.media,
},
);
if (!view) {
return null;
}
view.mergeInContext(
this._generateTimelineContext({ noSetWindow: options?.noSetWindow }),
);
@@ -813,7 +819,8 @@ export class FrigateCardTimelineCore extends LitElement {
);
},
}
: (false as TimelineOptionsCluster),
: // Timeline type information is incorrect requiring this 'as'.
(false as unknown as TimelineOptionsCluster),
minHeight: '100%',
maxHeight: '100%',
zoomMax: 1 * 24 * 60 * 60 * 1000,