Add event starring from the card.

This commit is contained in:
Dermot Duffy
2022-06-28 20:19:32 -07:00
parent 7f430298da
commit 0f04e9383a
15 changed files with 152 additions and 21 deletions
+9 -1
View File
@@ -86,6 +86,7 @@ export class FrigateCardGallery extends LitElement {
.hass=${this.hass}
.view=${this.view}
.galleryConfig=${this.galleryConfig}
.cameras=${this.cameras}
>
</frigate-card-gallery-core>
`;
@@ -116,6 +117,9 @@ export class FrigateCardGalleryCore extends LitElement {
@property({ attribute: false })
public galleryConfig?: GalleryConfig;
@property({ attribute: false })
public cameras?: Map<string, CameraConfig>;
protected _resizeObserver: ResizeObserver;
constructor() {
@@ -207,11 +211,13 @@ export class FrigateCardGalleryCore extends LitElement {
!this.view ||
!this.view.target ||
!this.view.target.children ||
!(this.view.is('clips') || this.view.is('snapshots'))
!(this.view.is('clips') || this.view.is('snapshots')) ||
!this.cameras
) {
return html``;
}
const cameraConfig = this.cameras.get(this.view.camera);
return html`
${this._showBackArrow()
? html` <ha-card
@@ -253,6 +259,8 @@ export class FrigateCardGalleryCore extends LitElement {
.view=${this.view}
.target=${this.view?.target ?? null}
.childIndex=${index}
.hass=${this.hass}
.clientID=${cameraConfig?.frigate.client_id}
?details=${!!this.galleryConfig?.controls.thumbnails.show_details}
?controls=${!!this.galleryConfig?.controls.thumbnails.show_controls}
@click=${(ev: Event) => {