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 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-04-06 14:10:20 +02:00
parent 19b2a172c8
commit 1a194d5050
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -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)
+1
View File
@@ -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'):