mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +01:00
update:修复智控台模式下,所选模块的日志名称
This commit is contained in:
parent
aa77bfdfc4
commit
12c957d48b
1 changed files with 10 additions and 4 deletions
|
|
@ -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):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue