diff --git a/src/editor.ts b/src/editor.ts index 870b561f..37a419a4 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -205,6 +205,13 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor .configValue=${'view_timeout'} @value-changed=${this._valueChanged} > + + + ` : ''}
@@ -309,8 +316,6 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor } const target = ev.target; let key: string = target.configValue; - console.log(target); - console.log(target.value); if (!key) { return; @@ -329,10 +334,8 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor objectTarget = newConfig[configName]; key = parts[1]; } - //console.log(`Value is: ${target.value}`); - //return; - if (objectTarget[key] === target.value) { + if (target.value !== undefined && objectTarget[key] === target.value) { return; } else if (target.value === '') { delete objectTarget[key]; diff --git a/src/frigate-hass-card.ts b/src/frigate-hass-card.ts index 24e6a68a..7654753c 100644 --- a/src/frigate-hass-card.ts +++ b/src/frigate-hass-card.ts @@ -543,6 +543,7 @@ export class FrigateCard extends LitElement { // Render the player for a saved clip. protected async _renderClipPlayer(): Promise { let event: FrigateEvent, events: FrigateGetEventsResponse; + let autoplay = true; if (this._viewEvent) { event = this._viewEvent; } else { @@ -558,10 +559,22 @@ export class FrigateCard extends LitElement { return this._renderAttentionIcon('mdi:camera-off', 'No recent clip'); } event = events[0]; + + // In this block, no clip has been manually selected, so this is loading + // the most recent clip on card load. In this mode, autoplay of the clip + // may be disabled by configuration. If does not make sense to disable + // autoplay when the user has explicitly picked an event to play in the + // gallery. + autoplay = this.config.autoplay_clip; } this._heading = this._getEventTitle(event); const url = `${this.config.frigate_url}/clips/` + `${event.camera}-${event.id}.mp4`; - return html`