fix(console): correct trace output format

Format: 12.50 > [5e]12.25 > [d1]-8.25 > [e7]-3.00
(SNR first, then each hop shows [hash]SNR)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-03-19 17:17:40 +01:00
parent 20924d134d
commit 4b4e71f5bd

View File

@@ -393,12 +393,12 @@ def _execute_console_command(args: list) -> str:
result = device_manager.send_trace(path)
if result.get('success'):
data = result['data']
# Format like meshcore-cli: snr [hash] > snr [hash] > ... snr
# Format: snr > [hash]snr > [hash]snr > ... > [hash]snr
parts = []
for t in data.get('path', []):
snr = f"{t['snr']:.2f}"
h = f"[{t['hash']}]" if 'hash' in t else ''
parts.append(f"{snr} {h}")
parts.append(f"{h}{snr}")
return " > ".join(parts) if parts else "(empty trace)"
return f"Error: {result.get('error')}"