Config Page: Device Tab. threshold component. fix problem that the input component focused out when input something each time. Set threshold data when started python.
14 lines
615 B
JavaScript
14 lines
615 B
JavaScript
import { useSpeakerDeviceList as useStoreSpeakerDeviceList } from "@store";
|
|
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
|
|
export const useSpeakerDeviceList = () => {
|
|
const { asyncStdoutToPython } = useStdoutToPython();
|
|
const { currentSpeakerDeviceList, updateSpeakerDeviceList } = useStoreSpeakerDeviceList();
|
|
|
|
const getSpeakerDeviceList = () => {
|
|
updateSpeakerDeviceList(() => new Promise(() => {}));
|
|
asyncStdoutToPython("/controller/list_speaker_device");
|
|
};
|
|
|
|
return { currentSpeakerDeviceList, getSpeakerDeviceList, updateSpeakerDeviceList };
|
|
}; |