👍️[Update] UI: backendのendpointに合わせて修正

This commit is contained in:
misyaguziya
2024-09-20 05:14:51 +09:00
parent d3b66b7000
commit ca6514b090
24 changed files with 700 additions and 705 deletions

View File

@@ -7,24 +7,24 @@ export const useMicThreshold = () => {
const { updateEnableAutomaticMicThreshold, currentEnableAutomaticMicThreshold } = useStore_EnableAutomaticMicThreshold();
const getMicThreshold = () => {
asyncStdoutToPython("/config/input_mic_energy_threshold");
asyncStdoutToPython("/get/mic_energy_threshold");
};
const setMicThreshold = (mic_threshold) => {
asyncStdoutToPython("/controller/callback_set_mic_energy_threshold", mic_threshold);
asyncStdoutToPython("/set/mic_energy_threshold", mic_threshold);
};
const getEnableAutomaticMicThreshold = () => {
updateEnableAutomaticMicThreshold(() => new Promise(() => {}));
asyncStdoutToPython("/config/input_mic_dynamic_energy_threshold");
asyncStdoutToPython("/get/mic_dynamic_energy_threshold");
};
const toggleEnableAutomaticMicThreshold = () => {
updateEnableAutomaticMicThreshold(() => new Promise(() => {}));
if (currentEnableAutomaticMicThreshold.data) {
asyncStdoutToPython("/controller/callback_disable_mic_dynamic_energy_threshold");
asyncStdoutToPython("/set/disable_mic_dynamic_energy_threshold");
} else {
asyncStdoutToPython("/controller/callback_enable_mic_dynamic_energy_threshold");
asyncStdoutToPython("/set/enable_mic_dynamic_energy_threshold");
}
};