diff --git a/m5stack/libs/unit/asr.py b/m5stack/libs/unit/asr.py index ace7e6df..e07ae04b 100644 --- a/m5stack/libs/unit/asr.py +++ b/m5stack/libs/unit/asr.py @@ -287,7 +287,8 @@ def search_command_num(self, command_word: str) -> int: asr.search_command_num("custom command") """ - return -1 + command_dict = {v[0]: k for k, v in self._COMMAND_LIST.items()} + return command_dict.get(command_word, -1) def search_command_word(self, command_num: int) -> str: """Search for the command word associated with a command number.