feat: Rename the card to advanced-camera-card (#1873)

Whilst the Frigate support in this card is the best among camera
engines, the name incorrectly suggests that Frigate is a requirement.
Instead, to broaden the appeal, change to more camera agnostic name.
This does not suggest any change in priority, role or support for
Frigate.

This change is likely to be bug prone, due to the size of the rename --
the code contains 1500+ references to "Frigate" most of which make sense
to rename, some which do not, all of which needed human assessment.

- Closes #1298


BREAKING CHANGE: References to `frigate-card` in all kinds of
configuration need to be updated to `advanced-camera-card`. An automated
config upgrade should take care of the majority of usecases (click `Edit
-> Upgrade -> Save`), though may not be perfect.
This commit is contained in:
Dermot Duffy
2025-02-06 19:32:32 -08:00
committed by GitHub
parent 43947b49dc
commit cc376a8be1
305 changed files with 4270 additions and 3686 deletions
+17 -15
View File
@@ -17,12 +17,12 @@ import {
} from '../config/types.js';
import basicBlockStyle from '../scss/basic-block.scss';
import { ExtendedHomeAssistant } from '../types.js';
import { contentsChanged, dispatchFrigateCardEvent } from '../utils/basic.js';
import { contentsChanged, dispatchAdvancedCameraCardEvent } from '../utils/basic.js';
import './surround-basic.js';
import { ThumbnailCarouselTap } from './thumbnail-carousel.js';
@customElement('frigate-card-surround')
export class FrigateCardSurround extends LitElement {
@customElement('advanced-camera-card-surround')
export class AdvancedCameraCardSurround extends LitElement {
@property({ attribute: false })
public hass?: ExtendedHomeAssistant;
@@ -110,20 +110,22 @@ export class FrigateCardSurround extends LitElement {
// request to view thumbnails and re-dispatches a request to open the drawer
// (if the thumbnails are in a drawer). The new event needs to be dispatched
// from the origin of the inbound event, so it can be handled by
// <frigate-card-surround> .
// <advanced-camera-card-surround> .
if (this.thumbnailConfig && this._hasDrawer()) {
dispatchFrigateCardEvent(ev.composedPath()[0], 'drawer:' + action, {
dispatchAdvancedCameraCardEvent(ev.composedPath()[0], 'drawer:' + action, {
drawer: this.thumbnailConfig.mode,
});
}
};
return html` <frigate-card-surround-basic
@frigate-card:thumbnails:open=${(ev: CustomEvent) => changeDrawer(ev, 'open')}
@frigate-card:thumbnails:close=${(ev: CustomEvent) => changeDrawer(ev, 'close')}
return html` <advanced-camera-card-surround-basic
@advanced-camera-card:thumbnails:open=${(ev: CustomEvent) =>
changeDrawer(ev, 'open')}
@advanced-camera-card:thumbnails:close=${(ev: CustomEvent) =>
changeDrawer(ev, 'close')}
>
${this.thumbnailConfig && this.thumbnailConfig.mode !== 'none'
? html` <frigate-card-thumbnail-carousel
? html` <advanced-camera-card-thumbnail-carousel
slot=${this.thumbnailConfig.mode}
.hass=${this.hass}
.config=${this.thumbnailConfig}
@@ -131,7 +133,7 @@ export class FrigateCardSurround extends LitElement {
.fadeThumbnails=${view.isViewerView()}
.viewManagerEpoch=${this.viewManagerEpoch}
.selected=${view.queryResults?.getSelectedIndex() ?? undefined}
@frigate-card:thumbnail-carousel:tap=${(
@advanced-camera-card:thumbnail-carousel:tap=${(
ev: CustomEvent<ThumbnailCarouselTap>,
) => {
const media = ev.detail.queryResults.getSelectedResult();
@@ -150,10 +152,10 @@ export class FrigateCardSurround extends LitElement {
}
}}
>
</frigate-card-thumbnail-carousel>`
</advanced-camera-card-thumbnail-carousel>`
: ''}
${this.timelineConfig && this.timelineConfig.mode !== 'none'
? html` <frigate-card-timeline-core
? html` <advanced-camera-card-timeline-core
slot=${this.timelineConfig.mode}
.hass=${this.hass}
.viewManagerEpoch=${this.viewManagerEpoch}
@@ -169,10 +171,10 @@ export class FrigateCardSurround extends LitElement {
.cameraManager=${this.cameraManager}
.cardWideConfig=${this.cardWideConfig}
>
</frigate-card-timeline-core>`
</advanced-camera-card-timeline-core>`
: ''}
<slot></slot>
</frigate-card-surround-basic>`;
</advanced-camera-card-surround-basic>`;
}
static get styles(): CSSResultGroup {
@@ -182,6 +184,6 @@ export class FrigateCardSurround extends LitElement {
declare global {
interface HTMLElementTagNameMap {
'frigate-card-surround': FrigateCardSurround;
'advanced-camera-card-surround': AdvancedCameraCardSurround;
}
}