diff --git a/src/frigate-hass-card.ts b/src/frigate-hass-card.ts index 6d27f222..140048e9 100644 --- a/src/frigate-hass-card.ts +++ b/src/frigate-hass-card.ts @@ -26,7 +26,11 @@ import './editor'; import frigate_card_style from './frigate-hass-card.scss'; import frigate_card_menu_style from './frigate-hass-card-menu.scss'; -import { frigateCardConfigSchema, frigateGetEventsResponseSchema, FrigateMenuMode } from './types'; +import { + frigateCardConfigSchema, + frigateGetEventsResponseSchema, + FrigateMenuMode, +} from './types'; import type { FrigateCardView, FrigateCardConfig, @@ -96,7 +100,7 @@ export class FrigateCardMenu extends LitElement { static FRIGATE_CARD_MENU_ID: string = 'frigate-card-menu-id' as const; @property({ attribute: false }) - protected menuMode: FrigateMenuMode = "hidden"; + protected menuMode: FrigateMenuMode = 'hidden'; @property({ attribute: false }) protected expand = false; @@ -122,7 +126,9 @@ export class FrigateCardMenu extends LitElement { protected _renderFrigateButton(): TemplateResult { return html` { @@ -152,72 +158,74 @@ export class FrigateCardMenu extends LitElement { : 'mdi:walk'; } - let menuClass = "frigate-card-menu-full"; - if (["hidden", "overlay"].includes(this.menuMode)) { + let menuClass = 'frigate-card-menu-full'; + if (['hidden', 'overlay'].includes(this.menuMode)) { if (this.menuMode == 'overlay' || this.expand) { - menuClass = "frigate-card-menu-overlay"; + menuClass = 'frigate-card-menu-overlay'; } else { - menuClass = "frigate-card-menu-hidden"; + menuClass = 'frigate-card-menu-hidden'; } } return html`
${this._renderFrigateButton()} - ${this.menuMode != "hidden" || this.expand ? html` - { - this.expand = false; - this._callAction('live'); - }} - > - { - this.expand = false; - this._callAction('clips'); - }} - > - { - this.expand = false; - this._callAction('snapshots'); - }} - > - { - this.expand = false; - this._callAction('frigate-ui'); - }} - > - ${!motionIcon - ? html`` - : html` { this.expand = false; - this._callAction('motion'); + this._callAction('live'); }} - >`} - ` : ``} + > + { + this.expand = false; + this._callAction('clips'); + }} + > + { + this.expand = false; + this._callAction('snapshots'); + }} + > + { + this.expand = false; + this._callAction('frigate-ui'); + }} + > + ${!motionIcon + ? html`` + : html` { + this.expand = false; + this._callAction('motion'); + }} + >`} + ` + : ``}
`; } @@ -327,8 +335,9 @@ export class FrigateCard extends LitElement { } protected _changeView( - view?: FrigateCardView | undefined, - event?: FrigateEvent | undefined): void { + view?: FrigateCardView | undefined, + event?: FrigateEvent | undefined, + ): void { if (view !== undefined) { this._viewMode = view; } else { @@ -476,7 +485,7 @@ export class FrigateCard extends LitElement { class="mdc-image-list__image" src="data:image/png;base64,${event.thumbnail}" @click=${() => { - this._changeView(want_clips ? 'clip' : 'snapshot' , event); + this._changeView(want_clips ? 'clip' : 'snapshot', event); }} /> @@ -552,7 +561,7 @@ export class FrigateCard extends LitElement { this._controlVideos({ stop: true, control_clip: true }); this._controlVideos({ stop: true, control_live: true }); this._changeView(); - break; + break; case 'live': this._controlVideos({ stop: true, control_clip: true }); this._controlVideos({ stop: false, control_live: true }); @@ -637,7 +646,8 @@ export class FrigateCard extends LitElement { this._eventBeingShown = event; - return html`