Add editor and migration support.

This commit is contained in:
Dermot Duffy
2024-01-21 11:30:23 -08:00
parent 278f4f372d
commit 64a909ead0
16 changed files with 385 additions and 230 deletions
+45
View File
@@ -1166,6 +1166,51 @@ describe('should handle version specific upgrades', () => {
type: 'custom:frigate-card',
});
});
});
describe('should move and transform untrigger_reset', () => {
it('when true', () => {
const config = {
type: 'custom:frigate-card',
cameras: [{ camera_entity: 'camera.office' }],
view: {
scan: {
untrigger_reset: true,
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
type: 'custom:frigate-card',
cameras: [{ camera_entity: 'camera.office' }],
view: {
scan: {
actions: {
untrigger: 'default',
},
},
},
});
});
it('when false', () => {
const config = {
type: 'custom:frigate-card',
cameras: [{ camera_entity: 'camera.office' }],
view: {
scan: {
untrigger_reset: false,
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
type: 'custom:frigate-card',
cameras: [{ camera_entity: 'camera.office' }],
view: {
scan: {},
},
});
});
});
});