From 019d351ab79b229a9d93a937fd5829aa760f2eff Mon Sep 17 00:00:00 2001 From: MarekWo Date: Thu, 19 Mar 2026 16:17:42 +0100 Subject: [PATCH] fix(console): req_regions and req_owner output formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - req_regions: library returns string, not dict — was crashing with "'str' object has no attribute 'items'" - req_owner: format like meshcore-cli ("X is owned by Y") Co-Authored-By: Claude Opus 4.6 --- app/main.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/main.py b/app/main.py index 1c0a1a5..ffa6e72 100644 --- a/app/main.py +++ b/app/main.py @@ -442,10 +442,7 @@ def _execute_console_command(args: list) -> str: result = device_manager.repeater_req_regions(name) if result.get('success'): data = result['data'] - lines = [f"Regions of {name}:"] - for k, v in data.items(): - lines.append(f" {k}: {v}") - return "\n".join(lines) + return f"{name} repeats {data}" return f"Error: {result.get('error')}" elif cmd == 'req_owner' and len(args) >= 2: @@ -453,10 +450,10 @@ def _execute_console_command(args: list) -> str: result = device_manager.repeater_req_owner(name) if result.get('success'): data = result['data'] - lines = [f"Owner of {name}:"] - for k, v in data.items(): - lines.append(f" {k}: {v}") - return "\n".join(lines) + owner = data.get('owner', '') + if owner: + return f"{data.get('name', name)} is owned by {owner}" + return f"{data.get('name', name)} has no owner set" return f"Error: {result.get('error')}" elif cmd == 'req_acl' and len(args) >= 2: