feat: Add microphone_connect action (#1537)

This commit is contained in:
Felipe Santos
2024-09-15 20:17:48 -07:00
committed by GitHub
parent 03ff02083d
commit af4666e023
7 changed files with 67 additions and 25 deletions
@@ -0,0 +1,18 @@
import { expect, it } from 'vitest';
import { MicrophoneConnectAction } from '../../../../src/card-controller/actions/actions/microphone-connect';
import { createCardAPI } from '../../../test-utils';
it('should handle microphone_connect action', async () => {
const api = createCardAPI();
const action = new MicrophoneConnectAction(
{},
{
action: 'fire-dom-event',
frigate_card_action: 'microphone_connect',
},
);
await action.execute(api);
expect(api.getMicrophoneManager().connect).toBeCalled();
});