Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/meshcore_console/mock/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,11 @@ def logout_from_repeater(self, peer_name: str) -> None:
self._append_event({"type": EventType.REPEATER_LOGOUT, "data": {"peer_name": peer_name}})

def send_repeater_command(self, peer_name: str, command: str) -> dict:
cmd_key = command.strip().split()[0].lower() if command.strip() else ""
response_text = MOCK_CLI_RESPONSES.get(cmd_key, f"OK: {command}")
stripped = command.strip().lower()
cmd_key = stripped.split()[0] if stripped else ""
response_text = MOCK_CLI_RESPONSES.get(stripped) or MOCK_CLI_RESPONSES.get(
cmd_key, f"OK: {command}"
)
self._append_event(
{
"type": EventType.REPEATER_COMMAND_RESPONSE,
Expand Down
1 change: 1 addition & 0 deletions src/meshcore_console/mock/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
" Bob -82 dBm SNR 3.2 0 hops\n"
" Charlie -91 dBm SNR -1.0 0 hops"
),
"get repeat": "repeat: ON",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep mock key parsing consistent for multi-word commands

MOCK_CLI_RESPONSES now stores "get repeat", but MockMeshcoreClient.send_repeater_command() only looks up the first token (command.strip().split()[0].lower()). In mock mode, pressing the new quick button sends get repeat and resolves key get, so the intended mock output (repeat: ON) is never returned and developers see the generic fallback instead, reducing parity with real repeater behavior during UI testing.

Useful? React with πŸ‘Β / πŸ‘Ž.

"telemetry": (
"Battery: 3.82V (74%)\n"
"Temperature: 32.1 C\n"
Expand Down
2 changes: 1 addition & 1 deletion src/meshcore_console/ui_gtk/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _build_console_tab(self) -> Gtk.Box:
quick_row.set_margin_end(8)
quick_row.set_margin_top(8)
quick_row.set_margin_bottom(4)
for cmd in ("neighbors", "telemetry", "reboot", "ver"):
for cmd in ("neighbors", "telemetry", "get repeat", "reboot", "ver"):
btn = Gtk.Button.new_with_label(cmd)
btn.add_css_class("quick-cmd-btn")
btn.connect("clicked", self._on_quick_cmd, cmd)
Expand Down
Loading