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:
@@ -26,7 +26,7 @@ describe('LiveController', () => {
|
||||
const host = createLitElement();
|
||||
const parent = createParent({ children: [host] });
|
||||
const eventListener = vi.fn();
|
||||
parent.addEventListener('frigate-card:media:loaded', eventListener);
|
||||
parent.addEventListener('advanced-camera-card:media:loaded', eventListener);
|
||||
|
||||
const controller = new LiveController(host);
|
||||
expect(host.addController).toBeCalled();
|
||||
@@ -70,7 +70,7 @@ describe('LiveController', () => {
|
||||
const host = createLitElement();
|
||||
const parent = createParent({ children: [host] });
|
||||
const eventListener = vi.fn();
|
||||
parent.addEventListener('frigate-card:media:loaded', eventListener);
|
||||
parent.addEventListener('advanced-camera-card:media:loaded', eventListener);
|
||||
|
||||
const controller = new LiveController(host);
|
||||
const mediaLoadedInfo = createMediaLoadedInfo();
|
||||
|
||||
@@ -5,7 +5,7 @@ import { dispatchLiveErrorEvent } from '../../../../src/components-lib/live/util
|
||||
it('should dispatch live error event', () => {
|
||||
const element = document.createElement('div');
|
||||
const handler = vi.fn();
|
||||
element.addEventListener('frigate-card:live:error', handler);
|
||||
element.addEventListener('advanced-camera-card:live:error', handler);
|
||||
|
||||
dispatchLiveErrorEvent(element);
|
||||
expect(handler).toBeCalled();
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
MediaActionsController,
|
||||
MediaActionsControllerOptions,
|
||||
} from '../../src/components-lib/media-actions-controller';
|
||||
import { FrigateCardMediaPlayer } from '../../src/types';
|
||||
import { AdvancedCameraCardMediaPlayer } from '../../src/types';
|
||||
import {
|
||||
IntersectionObserverMock,
|
||||
MutationObserverMock,
|
||||
@@ -18,11 +18,11 @@ import { callVisibilityHandler, createTestSlideNodes } from '../utils/embla/test
|
||||
const getPlayer = (
|
||||
element: HTMLElement,
|
||||
selector: string,
|
||||
): (HTMLElement & FrigateCardMediaPlayer) | null => {
|
||||
): (HTMLElement & AdvancedCameraCardMediaPlayer) | null => {
|
||||
return element.querySelector(selector);
|
||||
};
|
||||
|
||||
const createPlayer = (): HTMLElement & FrigateCardMediaPlayer => {
|
||||
const createPlayer = (): HTMLElement & AdvancedCameraCardMediaPlayer => {
|
||||
const player = document.createElement('video');
|
||||
|
||||
player['play'] = vi.fn();
|
||||
@@ -35,7 +35,7 @@ const createPlayer = (): HTMLElement & FrigateCardMediaPlayer => {
|
||||
player['setControls'] = vi.fn();
|
||||
player['isPaused'] = vi.fn();
|
||||
|
||||
return player as unknown as HTMLElement & FrigateCardMediaPlayer;
|
||||
return player as unknown as HTMLElement & AdvancedCameraCardMediaPlayer;
|
||||
};
|
||||
|
||||
const createPlayerSlideNodes = (n = 10): HTMLElement[] => {
|
||||
@@ -231,7 +231,7 @@ describe('MediaActionsController', () => {
|
||||
controller.unsetTarget();
|
||||
|
||||
getPlayer(children[0], 'video')?.dispatchEvent(
|
||||
new Event('frigate-card:media:loaded'),
|
||||
new Event('advanced-camera-card:media:loaded'),
|
||||
);
|
||||
await flushPromises();
|
||||
|
||||
@@ -255,7 +255,7 @@ describe('MediaActionsController', () => {
|
||||
expect(getPlayer(children[0], 'video')?.play).toBeCalledTimes(1);
|
||||
|
||||
getPlayer(children[0], 'video')?.dispatchEvent(
|
||||
new Event('frigate-card:media:loaded'),
|
||||
new Event('advanced-camera-card:media:loaded'),
|
||||
);
|
||||
|
||||
await flushPromises();
|
||||
@@ -277,7 +277,7 @@ describe('MediaActionsController', () => {
|
||||
expect(getPlayer(children[0], 'video')?.unmute).toBeCalledTimes(1);
|
||||
|
||||
getPlayer(children[0], 'video')?.dispatchEvent(
|
||||
new Event('frigate-card:media:loaded'),
|
||||
new Event('advanced-camera-card:media:loaded'),
|
||||
);
|
||||
|
||||
await flushPromises();
|
||||
@@ -299,7 +299,7 @@ describe('MediaActionsController', () => {
|
||||
await controller.setTarget(0, true);
|
||||
|
||||
getPlayer(children[9], 'video')?.dispatchEvent(
|
||||
new Event('frigate-card:media:loaded'),
|
||||
new Event('advanced-camera-card:media:loaded'),
|
||||
);
|
||||
|
||||
await flushPromises();
|
||||
@@ -325,7 +325,7 @@ describe('MediaActionsController', () => {
|
||||
expect(getPlayer(children[0], 'video')?.unmute).toBeCalledTimes(1);
|
||||
|
||||
getPlayer(children[0], 'video')?.dispatchEvent(
|
||||
new Event('frigate-card:media:loaded'),
|
||||
new Event('advanced-camera-card:media:loaded'),
|
||||
);
|
||||
|
||||
await flushPromises();
|
||||
|
||||
@@ -174,7 +174,7 @@ describe('MediaGridController', () => {
|
||||
const controller = createController(slot);
|
||||
|
||||
const mediaLoadedInfoHandler = vi.fn();
|
||||
host.addEventListener('frigate-card:media:loaded', mediaLoadedInfoHandler);
|
||||
host.addEventListener('advanced-camera-card:media:loaded', mediaLoadedInfoHandler);
|
||||
dispatchExistingMediaLoadedInfoAsEvent(children[0], mediaLoadedInfo);
|
||||
|
||||
controller.selectCell('0');
|
||||
@@ -194,7 +194,7 @@ describe('MediaGridController', () => {
|
||||
controller.selectCell('0');
|
||||
|
||||
const mediaLoadedInfoHandler = vi.fn();
|
||||
host.addEventListener('frigate-card:media:loaded', mediaLoadedInfoHandler);
|
||||
host.addEventListener('advanced-camera-card:media:loaded', mediaLoadedInfoHandler);
|
||||
dispatchExistingMediaLoadedInfoAsEvent(children[0], mediaLoadedInfo);
|
||||
|
||||
expect(mediaLoadedInfoHandler).toBeCalledWith(
|
||||
@@ -213,7 +213,7 @@ describe('MediaGridController', () => {
|
||||
controller.selectCell('1');
|
||||
|
||||
const mediaLoadedInfoHandler = vi.fn();
|
||||
host.addEventListener('frigate-card:media:loaded', mediaLoadedInfoHandler);
|
||||
host.addEventListener('advanced-camera-card:media:loaded', mediaLoadedInfoHandler);
|
||||
dispatchExistingMediaLoadedInfoAsEvent(children[0], mediaLoadedInfo);
|
||||
|
||||
// Another element is selected, so the event should not have propagated.
|
||||
@@ -228,8 +228,11 @@ describe('MediaGridController', () => {
|
||||
|
||||
const unselectedHandler = vi.fn();
|
||||
const unloadMediaHandler = vi.fn();
|
||||
host.addEventListener('frigate-card:media-grid:unselected', unselectedHandler);
|
||||
host.addEventListener('frigate-card:media:unloaded', unloadMediaHandler);
|
||||
host.addEventListener(
|
||||
'advanced-camera-card:media-grid:unselected',
|
||||
unselectedHandler,
|
||||
);
|
||||
host.addEventListener('advanced-camera-card:media:unloaded', unloadMediaHandler);
|
||||
|
||||
controller.selectCell('0');
|
||||
expect(controller.getSelected()).toBe('0');
|
||||
@@ -401,9 +404,9 @@ describe('MediaGridController', () => {
|
||||
columnWidth: 245,
|
||||
}),
|
||||
);
|
||||
expect(parent.style.getPropertyValue('--frigate-card-grid-column-size')).toBe(
|
||||
'245px',
|
||||
);
|
||||
expect(
|
||||
parent.style.getPropertyValue('--advanced-camera-card-grid-column-size'),
|
||||
).toBe('245px');
|
||||
});
|
||||
|
||||
it('should respect exact columns', () => {
|
||||
@@ -420,9 +423,9 @@ describe('MediaGridController', () => {
|
||||
columnWidth: 1499,
|
||||
}),
|
||||
);
|
||||
expect(parent.style.getPropertyValue('--frigate-card-grid-column-size')).toBe(
|
||||
'1499px',
|
||||
);
|
||||
expect(
|
||||
parent.style.getPropertyValue('--advanced-camera-card-grid-column-size'),
|
||||
).toBe('1499px');
|
||||
});
|
||||
|
||||
it('should respect selected width factor', () => {
|
||||
@@ -430,13 +433,13 @@ describe('MediaGridController', () => {
|
||||
const controller = createController(parent);
|
||||
controller.setDisplayConfig({ mode: 'grid', grid_selected_width_factor: 3 });
|
||||
expect(
|
||||
parent.style.getPropertyValue('--frigate-card-grid-selected-width-factor'),
|
||||
parent.style.getPropertyValue('--advanced-camera-card-grid-selected-width-factor'),
|
||||
).toBe('3');
|
||||
|
||||
// Setting the same config again should do nothing.
|
||||
controller.setDisplayConfig({ mode: 'grid', grid_selected_width_factor: 3 });
|
||||
expect(
|
||||
parent.style.getPropertyValue('--frigate-card-grid-selected-width-factor'),
|
||||
parent.style.getPropertyValue('--advanced-camera-card-grid-selected-width-factor'),
|
||||
).toBe('3');
|
||||
});
|
||||
|
||||
@@ -490,9 +493,9 @@ describe('MediaGridController', () => {
|
||||
columnWidth: 245,
|
||||
}),
|
||||
);
|
||||
expect(parent.style.getPropertyValue('--frigate-card-grid-column-size')).toBe(
|
||||
'245px',
|
||||
);
|
||||
expect(
|
||||
parent.style.getPropertyValue('--advanced-camera-card-grid-column-size'),
|
||||
).toBe('245px');
|
||||
|
||||
// Clear mock state.
|
||||
vi.mocked(Masonry).mockClear();
|
||||
@@ -509,9 +512,9 @@ describe('MediaGridController', () => {
|
||||
columnWidth: 599,
|
||||
}),
|
||||
);
|
||||
expect(parent.style.getPropertyValue('--frigate-card-grid-column-size')).toBe(
|
||||
'599px',
|
||||
);
|
||||
expect(
|
||||
parent.style.getPropertyValue('--advanced-camera-card-grid-column-size'),
|
||||
).toBe('599px');
|
||||
expect(masonry.layout).toBeCalled();
|
||||
|
||||
// Clear mock state.
|
||||
|
||||
@@ -14,12 +14,12 @@ import {
|
||||
MenuButtonControllerOptions,
|
||||
} from '../../src/components-lib/menu-button-controller';
|
||||
import {
|
||||
FrigateCardConfig,
|
||||
FrigateCardView,
|
||||
AdvancedCameraCardConfig,
|
||||
AdvancedCameraCardView,
|
||||
MenuItem,
|
||||
ViewDisplayMode,
|
||||
} from '../../src/config/types';
|
||||
import { FrigateCardMediaPlayer } from '../../src/types';
|
||||
import { AdvancedCameraCardMediaPlayer } from '../../src/types';
|
||||
import { createGeneralAction } from '../../src/utils/action';
|
||||
import { ViewMedia } from '../../src/view/media';
|
||||
import { MediaQueriesResults } from '../../src/view/media-queries-results';
|
||||
@@ -45,7 +45,7 @@ const calculateButtons = (
|
||||
controller: MenuButtonController,
|
||||
options?: MenuButtonControllerOptions & {
|
||||
hass?: HomeAssistant;
|
||||
config?: FrigateCardConfig;
|
||||
config?: AdvancedCameraCardConfig;
|
||||
cameraManager?: CameraManager;
|
||||
view?: View | null;
|
||||
viewManager?: ViewManager;
|
||||
@@ -72,7 +72,7 @@ const calculateButtons = (
|
||||
describe('MenuButtonController', () => {
|
||||
let controller: MenuButtonController;
|
||||
const dynamicButton: MenuItem = {
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:alpha-a-circle',
|
||||
title: 'Dynamic button',
|
||||
};
|
||||
@@ -82,17 +82,17 @@ describe('MenuButtonController', () => {
|
||||
controller = new MenuButtonController();
|
||||
});
|
||||
|
||||
describe('should have default menu button', () => {
|
||||
describe('should have iris menu button', () => {
|
||||
it('with hidden menu style', () => {
|
||||
const buttons = calculateButtons(controller);
|
||||
|
||||
expect(buttons).toContainEqual({
|
||||
icon: 'frigate',
|
||||
icon: 'iris',
|
||||
enabled: true,
|
||||
permanent: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
title: 'Frigate menu / Default view',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Iris / Default View / Unhide menu',
|
||||
tap_action: createGeneralAction('menu_toggle'),
|
||||
hold_action: createGeneralAction('diagnostics'),
|
||||
});
|
||||
@@ -104,12 +104,12 @@ describe('MenuButtonController', () => {
|
||||
});
|
||||
|
||||
expect(buttons).toContainEqual({
|
||||
icon: 'frigate',
|
||||
icon: 'iris',
|
||||
enabled: true,
|
||||
permanent: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
title: 'Frigate menu / Default view',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Iris / Default View / Unhide menu',
|
||||
tap_action: createGeneralAction('default'),
|
||||
hold_action: createGeneralAction('diagnostics'),
|
||||
});
|
||||
@@ -138,7 +138,7 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:video-switch',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-submenu',
|
||||
type: 'custom:advanced-camera-card-menu-submenu',
|
||||
title: 'Cameras',
|
||||
items: [
|
||||
{
|
||||
@@ -150,7 +150,7 @@ describe('MenuButtonController', () => {
|
||||
selected: true,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'camera_select',
|
||||
advanced_camera_card_action: 'camera_select',
|
||||
camera: 'camera-1',
|
||||
},
|
||||
},
|
||||
@@ -163,7 +163,7 @@ describe('MenuButtonController', () => {
|
||||
selected: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'camera_select',
|
||||
advanced_camera_card_action: 'camera_select',
|
||||
camera: 'camera-2',
|
||||
},
|
||||
},
|
||||
@@ -252,10 +252,10 @@ describe('MenuButtonController', () => {
|
||||
title: 'Substream(s)',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'live_substream_on',
|
||||
advanced_camera_card_action: 'live_substream_on',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -289,14 +289,14 @@ describe('MenuButtonController', () => {
|
||||
|
||||
expect(buttons).toContainEqual({
|
||||
icon: 'mdi:video-input-component',
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
title: 'Substream(s)',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'live_substream_off',
|
||||
advanced_camera_card_action: 'live_substream_off',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -354,7 +354,7 @@ describe('MenuButtonController', () => {
|
||||
style: {},
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-submenu',
|
||||
type: 'custom:advanced-camera-card-menu-submenu',
|
||||
items: [
|
||||
{
|
||||
enabled: true,
|
||||
@@ -365,7 +365,7 @@ describe('MenuButtonController', () => {
|
||||
selected: true,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'live_substream_select',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-1',
|
||||
},
|
||||
},
|
||||
@@ -378,7 +378,7 @@ describe('MenuButtonController', () => {
|
||||
selected: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'live_substream_select',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-2',
|
||||
},
|
||||
},
|
||||
@@ -391,7 +391,7 @@ describe('MenuButtonController', () => {
|
||||
selected: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'live_substream_select',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-3',
|
||||
},
|
||||
},
|
||||
@@ -443,10 +443,10 @@ describe('MenuButtonController', () => {
|
||||
expect(buttons).toContainEqual({
|
||||
icon: 'mdi:video-input-component',
|
||||
title: 'Substream(s)',
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-submenu',
|
||||
type: 'custom:advanced-camera-card-menu-submenu',
|
||||
items: [
|
||||
{
|
||||
enabled: true,
|
||||
@@ -457,7 +457,7 @@ describe('MenuButtonController', () => {
|
||||
selected: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'live_substream_select',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-1',
|
||||
},
|
||||
},
|
||||
@@ -472,7 +472,7 @@ describe('MenuButtonController', () => {
|
||||
selected: true,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'live_substream_select',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-2',
|
||||
},
|
||||
},
|
||||
@@ -485,7 +485,7 @@ describe('MenuButtonController', () => {
|
||||
selected: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'live_substream_select',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-3',
|
||||
},
|
||||
},
|
||||
@@ -507,10 +507,10 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:cctv',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Live view',
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'live' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'live' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -526,10 +526,10 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:cctv',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Live view',
|
||||
style: {},
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'live' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'live' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -561,11 +561,11 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:filmstrip',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Clips gallery',
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'clips' },
|
||||
hold_action: { action: 'fire-dom-event', frigate_card_action: 'clip' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'clips' },
|
||||
hold_action: { action: 'fire-dom-event', advanced_camera_card_action: 'clip' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -580,11 +580,11 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:filmstrip',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Clips gallery',
|
||||
style: {},
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'clips' },
|
||||
hold_action: { action: 'fire-dom-event', frigate_card_action: 'clip' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'clips' },
|
||||
hold_action: { action: 'fire-dom-event', advanced_camera_card_action: 'clip' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -614,11 +614,17 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:camera',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Snapshots gallery',
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'snapshots' },
|
||||
hold_action: { action: 'fire-dom-event', frigate_card_action: 'snapshot' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'snapshots',
|
||||
},
|
||||
hold_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'snapshot',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -633,11 +639,17 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:camera',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Snapshots gallery',
|
||||
style: {},
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'snapshots' },
|
||||
hold_action: { action: 'fire-dom-event', frigate_card_action: 'snapshot' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'snapshots',
|
||||
},
|
||||
hold_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'snapshot',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -669,11 +681,17 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:album',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Recordings gallery',
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'recordings' },
|
||||
hold_action: { action: 'fire-dom-event', frigate_card_action: 'recording' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'recordings',
|
||||
},
|
||||
hold_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'recording',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -688,11 +706,17 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:album',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Recordings gallery',
|
||||
style: {},
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'recordings' },
|
||||
hold_action: { action: 'fire-dom-event', frigate_card_action: 'recording' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'recordings',
|
||||
},
|
||||
hold_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'recording',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -725,10 +749,10 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:image',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Static image',
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'image' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'image' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -745,10 +769,10 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:image',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Static image',
|
||||
style: {},
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'image' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'image' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -780,10 +804,13 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:chart-gantt',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Timeline view',
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'timeline' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'timeline',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -799,10 +826,13 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:chart-gantt',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Timeline view',
|
||||
style: {},
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'timeline' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'timeline',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -844,9 +874,12 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:download',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Download',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'download' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'download',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -909,9 +942,9 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:web',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Camera user interface',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'camera_ui' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'camera_ui' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -935,19 +968,19 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:microphone',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Microphone',
|
||||
style: {
|
||||
animation: 'pulse 3s infinite',
|
||||
color: 'var(--frigate-card-menu-button-critical-color)',
|
||||
color: 'var(--advanced-camera-card-menu-button-critical-color)',
|
||||
},
|
||||
start_tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'microphone_unmute',
|
||||
advanced_camera_card_action: 'microphone_unmute',
|
||||
},
|
||||
end_tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'microphone_mute',
|
||||
advanced_camera_card_action: 'microphone_mute',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -989,7 +1022,7 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:microphone-message-off',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Microphone',
|
||||
style: {},
|
||||
});
|
||||
@@ -1014,16 +1047,16 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:microphone-off',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Microphone',
|
||||
style: {},
|
||||
start_tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'microphone_unmute',
|
||||
advanced_camera_card_action: 'microphone_unmute',
|
||||
},
|
||||
end_tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'microphone_mute',
|
||||
advanced_camera_card_action: 'microphone_mute',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -1047,7 +1080,7 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:microphone-message-off',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Microphone',
|
||||
style: {},
|
||||
});
|
||||
@@ -1075,12 +1108,12 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:microphone-off',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Microphone',
|
||||
style: {},
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'microphone_unmute',
|
||||
advanced_camera_card_action: 'microphone_unmute',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -1107,15 +1140,15 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:microphone',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Microphone',
|
||||
style: {
|
||||
animation: 'pulse 3s infinite',
|
||||
color: 'var(--frigate-card-menu-button-critical-color)',
|
||||
color: 'var(--advanced-camera-card-menu-button-critical-color)',
|
||||
},
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'microphone_mute',
|
||||
advanced_camera_card_action: 'microphone_mute',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -1140,9 +1173,12 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:fullscreen',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Fullscreen',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'fullscreen' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'fullscreen',
|
||||
},
|
||||
style: {},
|
||||
});
|
||||
});
|
||||
@@ -1159,10 +1195,13 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:fullscreen-exit',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Fullscreen',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'fullscreen' },
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'fullscreen',
|
||||
},
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1188,9 +1227,9 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:arrow-expand-all',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Expand',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'expand' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'expand' },
|
||||
style: {},
|
||||
});
|
||||
});
|
||||
@@ -1202,10 +1241,10 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:arrow-collapse-all',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Expand',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'expand' },
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'expand' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1240,7 +1279,7 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:cast',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-submenu',
|
||||
type: 'custom:advanced-camera-card-menu-submenu',
|
||||
title: 'Send to media player',
|
||||
items: [
|
||||
{
|
||||
@@ -1252,13 +1291,13 @@ describe('MenuButtonController', () => {
|
||||
disabled: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'media_player',
|
||||
advanced_camera_card_action: 'media_player',
|
||||
media_player: 'media_player.tv',
|
||||
media_player_action: 'play',
|
||||
},
|
||||
hold_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'media_player',
|
||||
advanced_camera_card_action: 'media_player',
|
||||
media_player: 'media_player.tv',
|
||||
media_player_action: 'stop',
|
||||
},
|
||||
@@ -1293,7 +1332,7 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:cast',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-submenu',
|
||||
type: 'custom:advanced-camera-card-menu-submenu',
|
||||
title: 'Send to media player',
|
||||
items: [
|
||||
{
|
||||
@@ -1310,7 +1349,7 @@ describe('MenuButtonController', () => {
|
||||
});
|
||||
|
||||
it('should have pause button', () => {
|
||||
const player = mock<FrigateCardMediaPlayer>();
|
||||
const player = mock<AdvancedCameraCardMediaPlayer>();
|
||||
const buttons = calculateButtons(controller, {
|
||||
currentMediaLoadedInfo: createMediaLoadedInfo({
|
||||
capabilities: {
|
||||
@@ -1324,14 +1363,14 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:pause',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Play / Pause',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'pause' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'pause' },
|
||||
});
|
||||
});
|
||||
|
||||
it('should have play button', () => {
|
||||
const player = mock<FrigateCardMediaPlayer>();
|
||||
const player = mock<AdvancedCameraCardMediaPlayer>();
|
||||
player.isPaused.mockReturnValue(true);
|
||||
const buttons = calculateButtons(controller, {
|
||||
currentMediaLoadedInfo: createMediaLoadedInfo({
|
||||
@@ -1346,14 +1385,14 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:play',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Play / Pause',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'play' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'play' },
|
||||
});
|
||||
});
|
||||
|
||||
it('should have mute button', () => {
|
||||
const player = mock<FrigateCardMediaPlayer>();
|
||||
const player = mock<AdvancedCameraCardMediaPlayer>();
|
||||
const buttons = calculateButtons(controller, {
|
||||
currentMediaLoadedInfo: createMediaLoadedInfo({
|
||||
capabilities: {
|
||||
@@ -1367,14 +1406,14 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:volume-high',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Mute / Unmute',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'mute' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'mute' },
|
||||
});
|
||||
});
|
||||
|
||||
it('should have unmute button', () => {
|
||||
const player = mock<FrigateCardMediaPlayer>();
|
||||
const player = mock<AdvancedCameraCardMediaPlayer>();
|
||||
player.isMuted.mockReturnValue(true);
|
||||
const buttons = calculateButtons(controller, {
|
||||
currentMediaLoadedInfo: createMediaLoadedInfo({
|
||||
@@ -1389,16 +1428,16 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:volume-off',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Mute / Unmute',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'unmute' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'unmute' },
|
||||
});
|
||||
});
|
||||
|
||||
it('should have screenshot button', () => {
|
||||
const buttons = calculateButtons(controller, {
|
||||
currentMediaLoadedInfo: createMediaLoadedInfo({
|
||||
player: mock<FrigateCardMediaPlayer>(),
|
||||
player: mock<AdvancedCameraCardMediaPlayer>(),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -1406,9 +1445,12 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:monitor-screenshot',
|
||||
enabled: false,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title: 'Screenshot',
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'screenshot' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'screenshot',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1435,18 +1477,18 @@ describe('MenuButtonController', () => {
|
||||
icon: displayMode === 'single' ? 'mdi:grid' : 'mdi:grid-off',
|
||||
enabled: true,
|
||||
priority: 50,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
title:
|
||||
displayMode === 'grid'
|
||||
? 'Show single media viewer'
|
||||
: 'Show media viewer for each camera in a grid',
|
||||
style:
|
||||
displayMode === 'grid'
|
||||
? { color: 'var(--frigate-card-menu-button-active-color)' }
|
||||
? { color: 'var(--advanced-camera-card-menu-button-active-color)' }
|
||||
: {},
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'display_mode_select',
|
||||
advanced_camera_card_action: 'display_mode_select',
|
||||
display_mode: displayMode === 'single' ? 'grid' : 'single',
|
||||
},
|
||||
});
|
||||
@@ -1517,15 +1559,15 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:pan',
|
||||
priority: 50,
|
||||
style: {
|
||||
color: 'var(--frigate-card-menu-button-active-color)',
|
||||
color: 'var(--advanced-camera-card-menu-button-active-color)',
|
||||
},
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz_controls',
|
||||
advanced_camera_card_action: 'ptz_controls',
|
||||
enabled: false,
|
||||
},
|
||||
title: 'Show PTZ controls',
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1553,11 +1595,11 @@ describe('MenuButtonController', () => {
|
||||
style: {},
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz_controls',
|
||||
advanced_camera_card_action: 'ptz_controls',
|
||||
enabled: true,
|
||||
},
|
||||
title: 'Show PTZ controls',
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1583,15 +1625,15 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:pan',
|
||||
priority: 50,
|
||||
style: {
|
||||
color: 'var(--frigate-card-menu-button-active-color)',
|
||||
color: 'var(--advanced-camera-card-menu-button-active-color)',
|
||||
},
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz_controls',
|
||||
advanced_camera_card_action: 'ptz_controls',
|
||||
enabled: false,
|
||||
},
|
||||
title: 'Show PTZ controls',
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1624,15 +1666,15 @@ describe('MenuButtonController', () => {
|
||||
icon: 'mdi:pan',
|
||||
priority: 50,
|
||||
style: {
|
||||
color: 'var(--frigate-card-menu-button-active-color)',
|
||||
color: 'var(--advanced-camera-card-menu-button-active-color)',
|
||||
},
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz_controls',
|
||||
advanced_camera_card_action: 'ptz_controls',
|
||||
enabled: false,
|
||||
},
|
||||
title: 'Show PTZ controls',
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1648,7 +1690,7 @@ describe('MenuButtonController', () => {
|
||||
])(
|
||||
'%s view with isDefault %s',
|
||||
(
|
||||
viewName: FrigateCardView,
|
||||
viewName: AdvancedCameraCardView,
|
||||
isDefault: boolean | undefined,
|
||||
expectedResult: boolean,
|
||||
) => {
|
||||
@@ -1695,11 +1737,11 @@ describe('MenuButtonController', () => {
|
||||
priority: 50,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz_multi',
|
||||
advanced_camera_card_action: 'ptz_multi',
|
||||
target_id: targetID,
|
||||
},
|
||||
title: 'PTZ Home',
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
});
|
||||
} else {
|
||||
expect(buttons).not.toContainEqual(
|
||||
@@ -1747,7 +1789,7 @@ describe('MenuButtonController', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('with non-Frigate fire-dom-event action', () => {
|
||||
it('with non-advanced-camera-card fire-dom-event action', () => {
|
||||
const button: MenuItem = {
|
||||
...dynamicButton,
|
||||
tap_action: { action: 'fire-dom-event' },
|
||||
@@ -1761,37 +1803,40 @@ describe('MenuButtonController', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('with Frigate view action', () => {
|
||||
it('with advanced camera card view action', () => {
|
||||
const button: MenuItem = {
|
||||
...dynamicButton,
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'clips' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'clips' },
|
||||
};
|
||||
const view = createView({ view: 'clips' });
|
||||
controller.addDynamicMenuButton(button);
|
||||
|
||||
expect(calculateButtons(controller, { view: view })).toContainEqual({
|
||||
...button,
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
});
|
||||
});
|
||||
|
||||
it('with Frigate default action', () => {
|
||||
it('with advanced camera card default action', () => {
|
||||
const button: MenuItem = {
|
||||
...dynamicButton,
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'default' },
|
||||
tap_action: { action: 'fire-dom-event', advanced_camera_card_action: 'default' },
|
||||
};
|
||||
controller.addDynamicMenuButton(button);
|
||||
|
||||
expect(calculateButtons(controller)).toContainEqual({
|
||||
...button,
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
});
|
||||
});
|
||||
|
||||
it('with fullscreen action', () => {
|
||||
const button: MenuItem = {
|
||||
...dynamicButton,
|
||||
tap_action: { action: 'fire-dom-event', frigate_card_action: 'fullscreen' },
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'fullscreen',
|
||||
},
|
||||
};
|
||||
controller.addDynamicMenuButton(button);
|
||||
const fullscreenManager = mock<FullscreenManager>();
|
||||
@@ -1800,7 +1845,7 @@ describe('MenuButtonController', () => {
|
||||
|
||||
expect(calculateButtons(controller, { fullscreenManager })).toContainEqual({
|
||||
...button,
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1809,7 +1854,7 @@ describe('MenuButtonController', () => {
|
||||
...dynamicButton,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'camera_select',
|
||||
advanced_camera_card_action: 'camera_select',
|
||||
camera: 'foo',
|
||||
},
|
||||
};
|
||||
@@ -1818,7 +1863,7 @@ describe('MenuButtonController', () => {
|
||||
|
||||
expect(calculateButtons(controller, { view: view })).toContainEqual({
|
||||
...button,
|
||||
style: { color: 'var(--frigate-card-menu-button-active-color)' },
|
||||
style: { color: 'var(--advanced-camera-card-menu-button-active-color)' },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1827,7 +1872,7 @@ describe('MenuButtonController', () => {
|
||||
...dynamicButton,
|
||||
tap_action: [
|
||||
{ action: 'fire-dom-event' },
|
||||
{ action: 'fire-dom-event', frigate_card_action: 'clips' },
|
||||
{ action: 'fire-dom-event', advanced_camera_card_action: 'clips' },
|
||||
],
|
||||
};
|
||||
const view = createView({ camera: 'clips' });
|
||||
|
||||
@@ -18,7 +18,7 @@ describe('MenuController', () => {
|
||||
};
|
||||
const menuToggleAction = {
|
||||
action: 'fire-dom-event' as const,
|
||||
frigate_card_action: 'menu_toggle' as const,
|
||||
advanced_camera_card_action: 'menu_toggle' as const,
|
||||
};
|
||||
const tapActionConfig = {
|
||||
camera_entity: 'foo',
|
||||
@@ -46,7 +46,9 @@ describe('MenuController', () => {
|
||||
controller.setMenuConfig(config);
|
||||
expect(controller.getMenuConfig()).toBe(config);
|
||||
|
||||
expect(host.style.getPropertyValue('--frigate-card-menu-button-size')).toBe('21px');
|
||||
expect(host.style.getPropertyValue('--advanced-camera-card-menu-button-size')).toBe(
|
||||
'21px',
|
||||
);
|
||||
expect(host.getAttribute('data-style')).toBe('hover');
|
||||
expect(host.getAttribute('data-position')).toBe('left');
|
||||
expect(host.getAttribute('data-alignment')).toBe('top');
|
||||
@@ -79,24 +81,24 @@ describe('MenuController', () => {
|
||||
|
||||
controller.setButtons([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
priority: 20,
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:goat',
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:chicken',
|
||||
priority: 40,
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:horse',
|
||||
priority: 40,
|
||||
alignment: 'matching',
|
||||
@@ -105,7 +107,7 @@ describe('MenuController', () => {
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:sheep',
|
||||
priority: 30,
|
||||
alignment: 'matching',
|
||||
@@ -114,13 +116,13 @@ describe('MenuController', () => {
|
||||
|
||||
expect(controller.getButtons('matching')).toEqual([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:chicken',
|
||||
priority: 40,
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:horse',
|
||||
priority: 40,
|
||||
alignment: 'matching',
|
||||
@@ -130,16 +132,16 @@ describe('MenuController', () => {
|
||||
alignment: 'matching',
|
||||
icon: 'mdi:sheep',
|
||||
priority: 30,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
},
|
||||
{
|
||||
alignment: 'matching',
|
||||
icon: 'mdi:cow',
|
||||
priority: 20,
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:goat',
|
||||
alignment: 'matching',
|
||||
},
|
||||
@@ -156,19 +158,19 @@ describe('MenuController', () => {
|
||||
controller.setExpanded(true);
|
||||
controller.setButtons([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
priority: 99,
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
icon: 'frigate',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'iris',
|
||||
alignment: 'matching',
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:sheep',
|
||||
priority: 100,
|
||||
alignment: 'matching',
|
||||
@@ -177,19 +179,19 @@ describe('MenuController', () => {
|
||||
|
||||
expect(controller.getButtons('matching')).toEqual([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
icon: 'frigate',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'iris',
|
||||
alignment: 'matching',
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:sheep',
|
||||
priority: 100,
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
priority: 99,
|
||||
alignment: 'matching',
|
||||
@@ -207,25 +209,25 @@ describe('MenuController', () => {
|
||||
controller.setExpanded(false);
|
||||
controller.setButtons([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
priority: 100,
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
icon: 'frigate',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'iris',
|
||||
alignment: 'matching',
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:sheep',
|
||||
priority: 100,
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
alignment: 'matching',
|
||||
priority: 100,
|
||||
@@ -235,15 +237,15 @@ describe('MenuController', () => {
|
||||
|
||||
expect(controller.getButtons('matching')).toEqual([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
alignment: 'matching',
|
||||
priority: 100,
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
icon: 'frigate',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'iris',
|
||||
alignment: 'matching',
|
||||
permanent: true,
|
||||
},
|
||||
@@ -256,29 +258,29 @@ describe('MenuController', () => {
|
||||
const controller = new MenuController(createLitElement());
|
||||
controller.setButtons([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
alignment: 'opposing',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:sheep',
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
},
|
||||
]);
|
||||
|
||||
expect(controller.getButtons('matching')).toEqual([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:sheep',
|
||||
alignment: 'matching',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
},
|
||||
]);
|
||||
@@ -288,16 +290,16 @@ describe('MenuController', () => {
|
||||
const controller = new MenuController(createLitElement());
|
||||
controller.setButtons([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:sheep',
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:goat',
|
||||
enabled: true,
|
||||
},
|
||||
@@ -305,11 +307,11 @@ describe('MenuController', () => {
|
||||
|
||||
expect(controller.getButtons('matching')).toEqual([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:cow',
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:goat',
|
||||
enabled: true,
|
||||
},
|
||||
@@ -326,20 +328,20 @@ describe('MenuController', () => {
|
||||
|
||||
controller.setButtons([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
icon: 'frigate',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'iris',
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:sheep',
|
||||
},
|
||||
]);
|
||||
|
||||
expect(controller.getButtons('matching')).toEqual([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
icon: 'frigate',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'iris',
|
||||
permanent: true,
|
||||
},
|
||||
]);
|
||||
@@ -348,12 +350,12 @@ describe('MenuController', () => {
|
||||
|
||||
expect(controller.getButtons('matching')).toEqual([
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
icon: 'frigate',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'iris',
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
icon: 'mdi:sheep',
|
||||
},
|
||||
]);
|
||||
@@ -370,7 +372,7 @@ describe('MenuController', () => {
|
||||
it('should execute simple action in non-hidden menu', () => {
|
||||
const host = createLitElement();
|
||||
const handler = vi.fn();
|
||||
host.addEventListener('frigate-card:action:execution-request', handler);
|
||||
host.addEventListener('advanced-camera-card:action:execution-request', handler);
|
||||
|
||||
const controller = new MenuController(host);
|
||||
|
||||
@@ -386,7 +388,7 @@ describe('MenuController', () => {
|
||||
it('should execute simple action in with config in event', () => {
|
||||
const host = createLitElement();
|
||||
const handler = vi.fn();
|
||||
host.addEventListener('frigate-card:action:execution-request', handler);
|
||||
host.addEventListener('advanced-camera-card:action:execution-request', handler);
|
||||
|
||||
const controller = new MenuController(host);
|
||||
|
||||
@@ -401,7 +403,7 @@ describe('MenuController', () => {
|
||||
it('should execute simple array of actions in non-hidden menu', () => {
|
||||
const host = createLitElement();
|
||||
const handler = vi.fn();
|
||||
host.addEventListener('frigate-card:action:execution-request', handler);
|
||||
host.addEventListener('advanced-camera-card:action:execution-request', handler);
|
||||
|
||||
const controller = new MenuController(host);
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { expect, it, vi } from 'vitest';
|
||||
import { dispatchFrigateCardErrorEvent } from '../../../src/components-lib/message/dispatch';
|
||||
import { FrigateCardError } from '../../../src/types';
|
||||
import { dispatchAdvancedCameraCardErrorEvent } from '../../../src/components-lib/message/dispatch';
|
||||
import { AdvancedCameraCardError } from '../../../src/types';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
it('should ignore non-error', () => {
|
||||
const element = document.createElement('div');
|
||||
const handler = vi.fn();
|
||||
element.addEventListener('frigate-card:message', handler);
|
||||
element.addEventListener('advanced-camera-card:message', handler);
|
||||
|
||||
dispatchFrigateCardErrorEvent(element, 'NOT_FRIGATE_EVENT');
|
||||
dispatchAdvancedCameraCardErrorEvent(element, 'NOT_ADVANCED_CAMERA_CARD_EVENT');
|
||||
|
||||
expect(handler).not.toBeCalled();
|
||||
});
|
||||
@@ -16,9 +16,9 @@ it('should ignore non-error', () => {
|
||||
it('should dispatch error', () => {
|
||||
const element = document.createElement('div');
|
||||
const handler = vi.fn();
|
||||
element.addEventListener('frigate-card:message', handler);
|
||||
element.addEventListener('advanced-camera-card:message', handler);
|
||||
|
||||
dispatchFrigateCardErrorEvent(element, new Error('ERROR'));
|
||||
dispatchAdvancedCameraCardErrorEvent(element, new Error('ERROR'));
|
||||
|
||||
expect(handler).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
@@ -32,9 +32,12 @@ it('should dispatch error', () => {
|
||||
it('should dispatch error with context', () => {
|
||||
const element = document.createElement('div');
|
||||
const handler = vi.fn();
|
||||
element.addEventListener('frigate-card:message', handler);
|
||||
element.addEventListener('advanced-camera-card:message', handler);
|
||||
|
||||
dispatchFrigateCardErrorEvent(element, new FrigateCardError('ERROR', 'CONTEXT'));
|
||||
dispatchAdvancedCameraCardErrorEvent(
|
||||
element,
|
||||
new AdvancedCameraCardError('ERROR', 'CONTEXT'),
|
||||
);
|
||||
|
||||
expect(handler).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
|
||||
@@ -172,13 +172,13 @@ describe('PTZController', () => {
|
||||
expect(controller.getPTZActions()?.[actionName]).toEqual({
|
||||
start_tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz_multi',
|
||||
advanced_camera_card_action: 'ptz_multi',
|
||||
ptz_action: actionName,
|
||||
ptz_phase: 'start',
|
||||
},
|
||||
end_tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz_multi',
|
||||
advanced_camera_card_action: 'ptz_multi',
|
||||
ptz_action: actionName,
|
||||
ptz_phase: 'stop',
|
||||
},
|
||||
@@ -211,7 +211,7 @@ describe('PTZController', () => {
|
||||
expect(controller.getPTZActions()['home']).toEqual({
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: 'ptz_multi',
|
||||
advanced_camera_card_action: 'ptz_multi',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -229,7 +229,7 @@ describe('PTZController', () => {
|
||||
|
||||
const element = document.createElement('div');
|
||||
const handler = vi.fn();
|
||||
element.addEventListener('frigate-card:action:execution-request', handler);
|
||||
element.addEventListener('advanced-camera-card:action:execution-request', handler);
|
||||
|
||||
const controller = new PTZController(element);
|
||||
controller.setCamera();
|
||||
@@ -251,7 +251,7 @@ describe('PTZController', () => {
|
||||
it('should not call action without actions config', () => {
|
||||
const element = document.createElement('div');
|
||||
const handler = vi.fn();
|
||||
element.addEventListener('frigate-card:action:execution-request', handler);
|
||||
element.addEventListener('advanced-camera-card:action:execution-request', handler);
|
||||
|
||||
const controller = new PTZController(element);
|
||||
controller.setCamera();
|
||||
@@ -265,7 +265,7 @@ describe('PTZController', () => {
|
||||
it('should not call action without hass', () => {
|
||||
const element = document.createElement('div');
|
||||
const handler = vi.fn();
|
||||
element.addEventListener('frigate-card:action:execution-request', handler);
|
||||
element.addEventListener('advanced-camera-card:action:execution-request', handler);
|
||||
|
||||
const controller = new PTZController(element);
|
||||
controller.setCamera();
|
||||
|
||||
@@ -22,9 +22,9 @@ describe('StatusBarController', () => {
|
||||
controller.setConfig(config);
|
||||
|
||||
expect(controller.getConfig()).toEqual(config);
|
||||
expect(host.style.getPropertyValue('--frigate-card-status-bar-height')).toBe(
|
||||
'50px',
|
||||
);
|
||||
expect(
|
||||
host.style.getPropertyValue('--advanced-camera-card-status-bar-height'),
|
||||
).toBe('50px');
|
||||
expect(host.getAttribute('data-style')).toBe('hover');
|
||||
expect(host.getAttribute('data-position')).toBe('top');
|
||||
expect(host.requestUpdate).toHaveBeenCalled();
|
||||
@@ -79,7 +79,7 @@ describe('StatusBarController', () => {
|
||||
const controller = new StatusBarController(host);
|
||||
const items = [
|
||||
{
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Test',
|
||||
},
|
||||
];
|
||||
@@ -92,22 +92,22 @@ describe('StatusBarController', () => {
|
||||
const host = createLitElement();
|
||||
const controller = new StatusBarController(host);
|
||||
const item1 = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 1',
|
||||
priority: 40,
|
||||
};
|
||||
const item2 = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 2',
|
||||
priority: 10,
|
||||
};
|
||||
const item3 = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 3',
|
||||
priority: 60,
|
||||
};
|
||||
const item4 = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 4',
|
||||
priority: undefined,
|
||||
};
|
||||
@@ -120,12 +120,12 @@ describe('StatusBarController', () => {
|
||||
const host = createLitElement();
|
||||
const controller = new StatusBarController(host);
|
||||
const item1 = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 1',
|
||||
priority: 100,
|
||||
};
|
||||
const exclusiveItem = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 2',
|
||||
priority: 1,
|
||||
exclusive: true,
|
||||
@@ -140,12 +140,12 @@ describe('StatusBarController', () => {
|
||||
const host = createLitElement();
|
||||
const controller = new StatusBarController(host);
|
||||
const insufficientItem = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 1',
|
||||
sufficient: false,
|
||||
};
|
||||
const sufficientItem = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 2',
|
||||
sufficient: true,
|
||||
};
|
||||
@@ -159,12 +159,12 @@ describe('StatusBarController', () => {
|
||||
const host = createLitElement();
|
||||
const controller = new StatusBarController(host);
|
||||
const insufficientItem = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 1',
|
||||
sufficient: false,
|
||||
};
|
||||
const sufficientItem = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 2',
|
||||
sufficient: false,
|
||||
};
|
||||
@@ -188,7 +188,7 @@ describe('StatusBarController', () => {
|
||||
);
|
||||
|
||||
const sufficientItem = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 1',
|
||||
priority: 100,
|
||||
sufficient: true,
|
||||
@@ -210,7 +210,7 @@ describe('StatusBarController', () => {
|
||||
);
|
||||
|
||||
const insufficientItem = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 1',
|
||||
priority: 100,
|
||||
sufficient: false,
|
||||
@@ -231,19 +231,19 @@ describe('StatusBarController', () => {
|
||||
);
|
||||
|
||||
const sufficientString = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'String',
|
||||
priority: 100,
|
||||
sufficient: true,
|
||||
};
|
||||
const sufficientIcon = {
|
||||
type: 'custom:frigate-card-status-bar-icon',
|
||||
type: 'custom:advanced-camera-card-status-bar-icon',
|
||||
icon: 'Icon',
|
||||
priority: 100,
|
||||
sufficient: true,
|
||||
};
|
||||
const sufficientImage = {
|
||||
type: 'custom:frigate-card-status-bar-image',
|
||||
type: 'custom:advanced-camera-card-status-bar-image',
|
||||
image: 'Image',
|
||||
priority: 100,
|
||||
sufficient: true,
|
||||
@@ -275,7 +275,7 @@ describe('StatusBarController', () => {
|
||||
);
|
||||
|
||||
const sufficientItem = {
|
||||
type: 'custom:frigate-card-status-bar-string',
|
||||
type: 'custom:advanced-camera-card-status-bar-string',
|
||||
string: 'Item 1',
|
||||
priority: 100,
|
||||
sufficient: true,
|
||||
@@ -297,7 +297,7 @@ describe('StatusBarController', () => {
|
||||
it('should bail without action', () => {
|
||||
const host = createLitElement();
|
||||
const handler = vi.fn();
|
||||
host.addEventListener('frigate-card:action:execution-request', handler);
|
||||
host.addEventListener('advanced-camera-card:action:execution-request', handler);
|
||||
|
||||
const controller = new StatusBarController(host);
|
||||
controller.actionHandler(createInteractionEvent('tap'));
|
||||
@@ -307,7 +307,7 @@ describe('StatusBarController', () => {
|
||||
it('should request action execution', () => {
|
||||
const host = createLitElement();
|
||||
const handler = vi.fn();
|
||||
host.addEventListener('frigate-card:action:execution-request', handler);
|
||||
host.addEventListener('advanced-camera-card:action:execution-request', handler);
|
||||
|
||||
const controller = new StatusBarController(host);
|
||||
|
||||
|
||||
@@ -231,8 +231,8 @@ describe('ZoomController', () => {
|
||||
const element = document.createElement('div');
|
||||
const zoomedFunc = vi.fn();
|
||||
const unzoomedFunc = vi.fn();
|
||||
element.addEventListener('frigate-card:zoom:zoomed', zoomedFunc);
|
||||
element.addEventListener('frigate-card:zoom:unzoomed', unzoomedFunc);
|
||||
element.addEventListener('advanced-camera-card:zoom:zoomed', zoomedFunc);
|
||||
element.addEventListener('advanced-camera-card:zoom:unzoomed', unzoomedFunc);
|
||||
|
||||
vi.mocked(Panzoom).mockReturnValueOnce(createMockPanZoom());
|
||||
createAndRegisterZoom(element);
|
||||
@@ -267,8 +267,8 @@ describe('ZoomController', () => {
|
||||
const element = document.createElement('div');
|
||||
const zoomedFunc = vi.fn();
|
||||
const unzoomedFunc = vi.fn();
|
||||
element.addEventListener('frigate-card:zoom:zoomed', zoomedFunc);
|
||||
element.addEventListener('frigate-card:zoom:unzoomed', unzoomedFunc);
|
||||
element.addEventListener('advanced-camera-card:zoom:zoomed', zoomedFunc);
|
||||
element.addEventListener('advanced-camera-card:zoom:unzoomed', unzoomedFunc);
|
||||
|
||||
vi.mocked(Panzoom).mockReturnValueOnce(createMockPanZoom());
|
||||
createAndRegisterZoom(element);
|
||||
@@ -312,7 +312,7 @@ describe('ZoomController', () => {
|
||||
setElementToDefaultCardSize(element);
|
||||
|
||||
const changeFunc = vi.fn();
|
||||
element.addEventListener('frigate-card:zoom:change', changeFunc);
|
||||
element.addEventListener('advanced-camera-card:zoom:change', changeFunc);
|
||||
|
||||
vi.mocked(Panzoom).mockReturnValueOnce(createMockPanZoom());
|
||||
createAndRegisterZoom(element);
|
||||
@@ -357,7 +357,7 @@ describe('ZoomController', () => {
|
||||
setElementToDefaultCardSize(element);
|
||||
|
||||
const changeFunc = vi.fn();
|
||||
element.addEventListener('frigate-card:zoom:change', changeFunc);
|
||||
element.addEventListener('advanced-camera-card:zoom:change', changeFunc);
|
||||
|
||||
vi.mocked(Panzoom).mockReturnValueOnce(createMockPanZoom());
|
||||
const controller = createAndRegisterZoom(element);
|
||||
@@ -403,7 +403,7 @@ describe('ZoomController', () => {
|
||||
setElementToDefaultCardSize(element);
|
||||
|
||||
const changeFunc = vi.fn();
|
||||
element.addEventListener('frigate-card:zoom:change', changeFunc);
|
||||
element.addEventListener('advanced-camera-card:zoom:change', changeFunc);
|
||||
|
||||
vi.mocked(Panzoom).mockReturnValueOnce(createMockPanZoom());
|
||||
const controller = createAndRegisterZoom(element);
|
||||
|
||||
@@ -61,7 +61,7 @@ it('handleZoomSettingsObservedEvent', () => {
|
||||
const viewManager = mock<ViewManager>();
|
||||
|
||||
handleZoomSettingsObservedEvent(
|
||||
new CustomEvent('frigate-card:zoom:change', {
|
||||
new CustomEvent('advanced-camera-card:zoom:change', {
|
||||
detail: {
|
||||
pan: { x: 1, y: 2 },
|
||||
zoom: 3,
|
||||
|
||||
Reference in New Issue
Block a user