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,9 @@
import { GeneralActionConfig } from '../../../config/types';
import { CardActionsAPI } from '../../types';
import { FrigateCardAction } from './base';
export class MicrophoneConnectAction extends FrigateCardAction<GeneralActionConfig> {
public async execute(api: CardActionsAPI): Promise<void> {
await api.getMicrophoneManager().connect();
}
}
+3
View File
@@ -13,6 +13,7 @@ import { GenericAction } from './actions/generic';
import { LogAction } from './actions/log';
import { MediaPlayerAction } from './actions/media-player';
import { MenuToggleAction } from './actions/menu-toggle';
import { MicrophoneConnectAction } from './actions/microphone-connect';
import { MicrophoneDisconnectAction } from './actions/microphone-disconnect';
import { MicrophoneMuteAction } from './actions/microphone-mute';
import { MicrophoneUnmuteAction } from './actions/microphone-unmute';
@@ -97,6 +98,8 @@ export class ActionFactory {
return new SubstreamOnAction(context, frigateCardAction, options?.config);
case 'media_player':
return new MediaPlayerAction(context, frigateCardAction, options?.config);
case 'microphone_connect':
return new MicrophoneConnectAction(context, frigateCardAction, options?.config);
case 'microphone_disconnect':
return new MicrophoneDisconnectAction(
context,
+1
View File
@@ -270,6 +270,7 @@ const FRIGATE_CARD_GENERAL_ACTIONS = [
'live_substream_off',
'live_substream_on',
'menu_toggle',
'microphone_connect',
'microphone_disconnect',
'microphone_mute',
'microphone_unmute',