mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-07-04 00:42:00 +02:00
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:
@@ -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)
|
||||
|
||||
@@ -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'):
|
||||
|
||||
Reference in New Issue
Block a user