feat: Add microphone_disconnect action (#1536)

This commit is contained in:
Felipe Santos
2024-09-15 15:44:40 -07:00
committed by GitHub
parent b251911fbc
commit e13e53b430
7 changed files with 74 additions and 25 deletions
@@ -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();
}
}
+7
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 { 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':