feat: Add control/output of selected camera via an entity (#1895)

- Closes #1871
This commit is contained in:
Dermot Duffy
2025-02-17 13:33:10 -08:00
committed by GitHub
parent da79664a67
commit c66c3ec919
46 changed files with 677 additions and 91 deletions
@@ -0,0 +1,21 @@
import { expect, it, vi } from 'vitest';
import { InternalCallbackAction } from '../../../../src/card-controller/actions/actions/internal-callback';
import { INTERNAL_CALLBACK_ACTION } from '../../../../src/config/types';
import { createCardAPI } from '../../../test-utils';
it('should handle internal callback action', async () => {
const api = createCardAPI();
const callback = vi.fn();
const action = new InternalCallbackAction(
{},
{
action: 'fire-dom-event',
advanced_camera_card_action: INTERNAL_CALLBACK_ACTION,
callback: callback,
},
);
await action.execute(api);
expect(callback).toBeCalledWith(api);
});