From 251dbf035936587deef6b86fe70e5527222be6cf Mon Sep 17 00:00:00 2001 From: MarekWo Date: Tue, 27 Jan 2026 15:46:02 +0100 Subject: [PATCH] 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 --- app/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/main.py b/app/main.py index 64e1486..eb23ae3 100644 --- a/app/main.py +++ b/app/main.py @@ -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