From fe64dd9c93eeb639b80960dc23ae278baf4c4f4a Mon Sep 17 00:00:00 2001 From: James Smith Date: Sun, 5 Apr 2026 14:40:42 +0100 Subject: [PATCH] feat(api): add sdr_claims to /health and surface /devices/status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /health now includes sdr_claims: a dict mapping 'sdr_type:device_index' to the mode currently using that device (e.g. {"rtlsdr:0": "pager"}). Empty when no devices are in use. /devices/status already existed and returns the full device list with in_use/used_by per device — documented in the issue response. Closes #158 --- app.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 8e06966..cf2a90c 100644 --- a/app.py +++ b/app.py @@ -478,15 +478,15 @@ def login(): return render_template('login.html', version=VERSION) -@app.route('/') -def index() -> str: - if request.args.get('mode') == 'satellite': - return redirect(url_for('satellite.satellite_dashboard')) - - tools = { - 'rtl_fm': check_tool('rtl_fm'), - 'multimon': check_tool('multimon-ng'), - 'rtl_433': check_tool('rtl_433'), +@app.route('/') +def index() -> str: + if request.args.get('mode') == 'satellite': + return redirect(url_for('satellite.satellite_dashboard')) + + tools = { + 'rtl_fm': check_tool('rtl_fm'), + 'multimon': check_tool('multimon-ng'), + 'rtl_433': check_tool('rtl_433'), 'rtlamr': check_tool('rtlamr') } devices = [d.to_dict() for d in SDRFactory.detect_devices()] @@ -908,6 +908,7 @@ def health_check() -> Response: }, 'database': db_ok, 'sdr_devices': sdr_count, + 'sdr_claims': get_sdr_device_status(), 'rate_limiting': _has_limiter, 'processes': { 'pager': current_process is not None and (current_process.poll() is None if current_process else False),