mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-07-02 07:51:12 +02:00
fix: Filter out JSON packet lines from console output
JSON lines with payload_typename (internal mesh protocol data like CONTROL packets) are now filtered out from console output, showing only the human-readable results. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,7 @@ def clean_console_output(output: str, command: str) -> str:
|
||||
"""
|
||||
Clean meshcli console output by removing:
|
||||
- Prompt lines (e.g., "MarWoj|*" or "DeviceName|*[E]")
|
||||
- JSON packet lines (internal mesh protocol data)
|
||||
- Echoed command line
|
||||
- Leading/trailing whitespace
|
||||
"""
|
||||
@@ -112,6 +113,10 @@ def clean_console_output(output: str, command: str) -> str:
|
||||
if prompt_pattern.match(stripped):
|
||||
continue
|
||||
|
||||
# Skip JSON packet lines (internal mesh protocol data)
|
||||
if stripped.startswith('{') and '"payload_typename"' in stripped:
|
||||
continue
|
||||
|
||||
cleaned_lines.append(line)
|
||||
|
||||
# Remove leading empty lines
|
||||
|
||||
Reference in New Issue
Block a user