From 1a194d50501899d602a85abba765358c7479efd4 Mon Sep 17 00:00:00 2001 From: MarekWo Date: Mon, 6 Apr 2026 14:10:20 +0200 Subject: [PATCH] fix: implement get advert_loc_policy console command The set command was implemented but get was missing, causing "Unknown param" error. Reads adv_loc_policy from device info. Co-Authored-By: Claude Opus 4.6 --- app/device_manager.py | 2 ++ app/main.py | 1 + 2 files changed, 3 insertions(+) diff --git a/app/device_manager.py b/app/device_manager.py index 641984f..04aae96 100644 --- a/app/device_manager.py +++ b/app/device_manager.py @@ -2892,6 +2892,8 @@ class DeviceManager: if event and hasattr(event, 'payload'): return {'success': True, 'data': event.payload} return {'success': False, 'error': 'No custom vars response'} + elif param == 'advert_loc_policy': + return {'success': True, 'data': {'advert_loc_policy': info.get('adv_loc_policy', '?')}} elif param == 'path_hash_mode': # get_path_hash_mode() returns int, not Event value = self.execute(self.mc.commands.get_path_hash_mode(), timeout=5) diff --git a/app/main.py b/app/main.py index e3801d9..7c1c488 100644 --- a/app/main.py +++ b/app/main.py @@ -998,6 +998,7 @@ def _execute_console_command(args: list) -> str: " radio — radio parameters (freq, bw, sf, cr)\n" " stats — device status/statistics\n" " custom — all custom variables (JSON)\n" + " advert_loc_policy — location in adverts\n" " path_hash_mode — path hash mode" ) if result.get('success'):