Skip to content

Commit 54db025

Browse files
Tinyu-Zhaolbuque
authored andcommitted
libs/unit: Add command index search to ASR unit.
Signed-off-by: tinyu <[email protected]>
1 parent 78fd98b commit 54db025

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

m5stack/libs/unit/asr.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ def search_command_num(self, command_word: str) -> int:
287287
288288
asr.search_command_num("custom command")
289289
"""
290+
for key, value in self._COMMAND_LIST.items():
291+
if value[0] == command_word:
292+
return key
290293
return -1
291294

292295
def search_command_word(self, command_num: int) -> str:

0 commit comments

Comments
 (0)