feat: Add experimental reolink media support (#1694)

* feat: Add experimental rich reolink support.

* Formatting fix
This commit is contained in:
Dermot Duffy
2024-11-25 20:19:12 -08:00
committed by GitHub
parent e898b73d63
commit dada65e008
63 changed files with 3402 additions and 483 deletions
+13 -17
View File
@@ -48,35 +48,31 @@ export class FrigateCardNextPreviousControl extends LitElement {
return html``;
}
const renderIcon =
!this.thumbnail || ['chevrons', 'icons'].includes(this._controlConfig.style);
const classes = {
controls: true,
previous: this.direction === 'previous',
next: this.direction === 'next',
thumbnails: this._controlConfig.style === 'thumbnails',
icons: ['chevrons', 'icons'].includes(this._controlConfig.style),
button: ['chevrons', 'icons'].includes(this._controlConfig.style),
thumbnails: !renderIcon,
icons: renderIcon,
button: renderIcon,
};
if (['chevrons', 'icons'].includes(this._controlConfig.style)) {
let icon: string;
if (this._controlConfig.style === 'chevrons') {
icon = this.direction === 'previous' ? 'mdi:chevron-left' : 'mdi:chevron-right';
} else {
if (!this.icon) {
return html``;
}
icon = this.icon;
}
if (renderIcon) {
const icon =
!this.thumbnail || !this.icon || this._controlConfig.style === 'chevrons'
? this.direction === 'previous'
? 'mdi:chevron-left'
: 'mdi:chevron-right'
: this.icon;
return html` <ha-icon-button class="${classMap(classes)}" .label=${this.label}>
<ha-icon icon=${icon}></ha-icon>
</ha-icon-button>`;
}
if (!this.thumbnail) {
return html``;
}
return renderTask(
this,
this._embedThumbnailTask,