feat: Add richer card theme support (#1809)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user