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:
MarekWo
2026-01-27 15:46:02 +01:00
parent 9740fe3746
commit 251dbf0359
+5
View File
@@ -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