mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-31 14:43:57 +08:00
update:修复智控台模式下,所选模块的日志名称
This commit is contained in:
@@ -8,10 +8,16 @@ SERVER_VERSION = "0.3.14"
|
|||||||
|
|
||||||
|
|
||||||
def get_module_abbreviation(module_name, module_dict):
|
def get_module_abbreviation(module_name, module_dict):
|
||||||
"""获取模块名称的缩写,如果为空则返回00"""
|
"""获取模块名称的缩写,如果为空则返回00
|
||||||
return (
|
如果名称中包含下划线,则返回下划线后面的前两个字符
|
||||||
module_dict.get(module_name, "")[:2] if module_dict.get(module_name) else "00"
|
"""
|
||||||
)
|
module_value = module_dict.get(module_name, "")
|
||||||
|
if not module_value:
|
||||||
|
return "00"
|
||||||
|
if "_" in module_value:
|
||||||
|
parts = module_value.split("_")
|
||||||
|
return parts[-1][:2] if parts[-1] else "00"
|
||||||
|
return module_value[:2]
|
||||||
|
|
||||||
|
|
||||||
def build_module_string(selected_module):
|
def build_module_string(selected_module):
|
||||||
|
|||||||
Reference in New Issue
Block a user