feat: Add 'doorbell' configuration profile (#2511)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent ef9c9c8d5c
commit 406176eebc
14 changed files with 114 additions and 84 deletions
+26
View File
@@ -0,0 +1,26 @@
import { expect, it } from 'vitest';
import { DOORBELL_PROFILE } from '../../../src/config/profiles/doorbell';
import { setProfiles } from '../../../src/config/profiles/set-profiles';
import { advancedCameraCardConfigSchema } from '../../../src/config/schema/types';
import { createRawConfig } from '../../test-utils';
it('should contain expected defaults', () => {
expect(DOORBELL_PROFILE).toEqual({
'cameras_global.triggers.doorbell': true,
'view.triggers.actions.interaction_mode': 'all',
'view.triggers.actions.trigger': 'call',
'view.triggers.actions.untrigger': 'call',
'view.triggers.show_trigger_status': true,
});
});
it('should be parseable after application', () => {
const rawInputConfig = createRawConfig();
const parsedConfig = advancedCameraCardConfigSchema.parse(rawInputConfig);
setProfiles(rawInputConfig, parsedConfig, ['doorbell']);
// Reparse the config to ensure the profile did not introduce errors.
const parseResult = advancedCameraCardConfigSchema.safeParse(parsedConfig);
expect(parseResult.success, parseResult.error?.toString()).toBeTruthy();
});