Refactor JSMPEG signing/creation logic.

This commit is contained in:
Dermot Duffy
2021-10-22 21:38:04 -07:00
parent 9f39d23cfc
commit 7b2b829848
3 changed files with 112 additions and 81 deletions
+19 -17
View File
@@ -733,23 +733,25 @@ export class FrigateCard extends LitElement {
>
</frigate-card-viewer>`
: ``}
<!-- Note the subtle difference in condition below vs the other views in order
to always render the live view for live_preload mode -->
${(!this._message && this._view.is('live')) || this.config.live_preload
? html`
<frigate-card-live
.hass=${this._hass}
.config=${this.config}
.frigateCameraName=${this._frigateCameraName}
class="${classMap(liveClasses)}"
@frigate-card:media-load=${this._mediaLoadHandler}
@frigate-card:pause=${this._pauseHandler}
@frigate-card:play=${this._playHandler}
@frigate-card:message=${this._messageHandler}
>
</frigate-card-live>
`
: ``}
${
// Note the subtle difference in condition below vs the other views in order
// to always render the live view for live_preload mode.
(!this._message && this._view.is('live')) || this.config.live_preload
? html`
<frigate-card-live
.hass=${this._hass}
.config=${this.config}
.frigateCameraName=${this._frigateCameraName}
class="${classMap(liveClasses)}"
@frigate-card:media-load=${this._mediaLoadHandler}
@frigate-card:pause=${this._pauseHandler}
@frigate-card:play=${this._playHandler}
@frigate-card:message=${this._messageHandler}
>
</frigate-card-live>
`
: ``
}
${this.config.elements
? html`
<frigate-card-elements