feat: Add microphone_disconnect action (#1536)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { GeneralActionConfig } from '../../../config/types';
|
||||
import { CardActionsAPI } from '../../types';
|
||||
import { FrigateCardAction } from './base';
|
||||
|
||||
export class MicrophoneDisconnectAction extends FrigateCardAction<GeneralActionConfig> {
|
||||
public async execute(api: CardActionsAPI): Promise<void> {
|
||||
api.getMicrophoneManager().disconnect();
|
||||
}
|
||||
}
|
||||
@@ -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 { MicrophoneDisconnectAction } from './actions/microphone-disconnect';
|
||||
import { MicrophoneMuteAction } from './actions/microphone-mute';
|
||||
import { MicrophoneUnmuteAction } from './actions/microphone-unmute';
|
||||
import { MuteAction } from './actions/mute';
|
||||
@@ -96,6 +97,12 @@ export class ActionFactory {
|
||||
return new SubstreamOnAction(context, frigateCardAction, options?.config);
|
||||
case 'media_player':
|
||||
return new MediaPlayerAction(context, frigateCardAction, options?.config);
|
||||
case 'microphone_disconnect':
|
||||
return new MicrophoneDisconnectAction(
|
||||
context,
|
||||
frigateCardAction,
|
||||
options?.config,
|
||||
);
|
||||
case 'microphone_mute':
|
||||
return new MicrophoneMuteAction(context, frigateCardAction, options?.config);
|
||||
case 'microphone_unmute':
|
||||
|
||||
@@ -270,6 +270,7 @@ const FRIGATE_CARD_GENERAL_ACTIONS = [
|
||||
'live_substream_off',
|
||||
'live_substream_on',
|
||||
'menu_toggle',
|
||||
'microphone_disconnect',
|
||||
'microphone_mute',
|
||||
'microphone_unmute',
|
||||
'mute',
|
||||
|
||||
Reference in New Issue
Block a user