feat: Add richer card theme support (#1809)

This commit is contained in:
Dermot Duffy
2025-01-07 19:54:13 -08:00
committed by GitHub
parent f7ecb91578
commit 278560b5ac
65 changed files with 1187 additions and 352 deletions
+27
View File
@@ -3406,4 +3406,31 @@ describe('should handle version specific upgrades', () => {
postUpgradeChecks(config);
});
});
describe('v6.1.2+', () => {
describe('view.dark_mode -> view.dim', () => {
it.each([
['on' as const, true],
['auto' as const, false],
['off' as const, false],
])('%s', (darkMode: 'on' | 'off' | 'auto', expected: boolean) => {
const config = {
type: 'custom:frigate-card',
cameras: [{ camera_entity: 'camera.office' }],
view: {
dark_mode: darkMode,
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
type: 'custom:frigate-card',
cameras: [{ camera_entity: 'camera.office' }],
view: {
dim: expected,
},
});
postUpgradeChecks(config);
});
});
});
});
+5 -2
View File
@@ -285,7 +285,7 @@ describe('config defaults', () => {
},
},
status_bar: {
height: 30,
height: 40,
items: {
engine: {
enabled: true,
@@ -329,7 +329,6 @@ describe('config defaults', () => {
type: 'frigate-hass-card',
view: {
camera_select: 'current',
dark_mode: 'off',
default: 'live',
keyboard_shortcuts: {
enabled: true,
@@ -355,6 +354,9 @@ describe('config defaults', () => {
key: '-',
},
},
theme: {
themes: ['traditional'],
},
triggers: {
show_trigger_status: false,
untrigger_seconds: 0,
@@ -366,6 +368,7 @@ describe('config defaults', () => {
filter_selected_camera: true,
},
interaction_seconds: 300,
dim: false,
default_cycle_camera: false,
default_reset: {
after_interaction: false,