[Update] Config Page: Device tab. add mic device list.(not selectable yet.)
This commit is contained in:
@@ -2,6 +2,8 @@ import {
|
||||
useSoftwareVersion,
|
||||
useMicHostList,
|
||||
useSelectedMicHost,
|
||||
useMicDeviceList,
|
||||
useSelectedMicDevice,
|
||||
} from "@store";
|
||||
|
||||
import { useStdoutToPython } from "./useStdoutToPython";
|
||||
@@ -14,6 +16,8 @@ export const useConfig = () => {
|
||||
const { updateSoftwareVersion } = useSoftwareVersion();
|
||||
const { updateMicHostList } = useMicHostList();
|
||||
const { updateSelectedMicHost } = useSelectedMicHost();
|
||||
const { updateMicDeviceList } = useMicDeviceList();
|
||||
const { updateSelectedMicDevice } = useSelectedMicDevice();
|
||||
|
||||
|
||||
return {
|
||||
@@ -29,6 +33,15 @@ export const useConfig = () => {
|
||||
updateSelectedMicHost(payload.data);
|
||||
},
|
||||
|
||||
getMicDeviceList: () => asyncStdoutToPython("/controller/list_mic_device"),
|
||||
updateMicDeviceList: (payload) => {
|
||||
updateMicDeviceList(arrayToObject(payload.data));
|
||||
},
|
||||
getSelectedMicDevice: () => asyncStdoutToPython("/config/choice_mic_device"),
|
||||
updateSelectedMicDevice: (payload) => {
|
||||
updateSelectedMicDevice(payload.data);
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
@@ -19,6 +19,8 @@ export const useReceiveRoutes = () => {
|
||||
updateSoftwareVersion,
|
||||
updateMicHostList,
|
||||
updateSelectedMicHost,
|
||||
updateMicDeviceList,
|
||||
updateSelectedMicDevice,
|
||||
} = useConfig();
|
||||
|
||||
const routes = {
|
||||
@@ -32,7 +34,8 @@ export const useReceiveRoutes = () => {
|
||||
"/config/version": updateSoftwareVersion,
|
||||
"/controller/list_mic_host": updateMicHostList,
|
||||
"/config/choice_mic_host": updateSelectedMicHost,
|
||||
|
||||
"/controller/list_mic_device": updateMicDeviceList,
|
||||
"/config/choice_mic_device": updateSelectedMicDevice,
|
||||
|
||||
"/controller/callback_messagebox_send": updateSentMessageLog,
|
||||
"/action/transcription_send_mic_message": addSentMessageLog,
|
||||
|
||||
Reference in New Issue
Block a user