MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _rusense_model_active

Function _rusense_model_active

webapp_modern.py:337–359  ·  view source on GitHub ↗

Whether a trained model is active on the sensing-server (cached ~30s). Confidence is only calibrated/trustworthy with a model loaded; model-less it is uninformative (~0.5), so the confidence gates relax to avoid ever missing real presence for lack of a model.

()

Source from the content-addressed store, hash-verified

335 starting = bool(st.get('starting'))
336 error = st.get('error')
337 hint = st.get('hint')
338 name = st.get('name')
339 adapter = st.get('adapter')
340 autostopped = bool(st.get('autostopped'))
341 return jsonify({
342 'enabled': enabled,
343 'running': running,
344 # Still registering with BlueZ. Distinct from failed: on a slow board
345 # registration can outlast the start() wait and succeed shortly after,
346 # so the UI must keep polling rather than declare it broken.
347 'starting': starting,
348 'error': error,
349 # Plain-language next step when the controller refused to advertise —
350 # the raw BlueZ text ("Failed to register advertisement") says nothing
351 # about what to do about it.
352 'hint': hint,
353 'name': name,
354 # Configured preference ('' = auto: prefer the built-in controller).
355 'adapter': shared_data.config.get('ble_provisioning_adapter', ''),
356 'active_adapter': adapter,
357 'adapters': _ble_adapters(),
358 'autostop': bool(shared_data.config.get('ble_provisioning_autostop', False)),
359 # True once a phone provisioned and the peripheral freed the adapter.
360 'autostopped': autostopped,
361 # Power warning (under-voltage) — running BLE + a USB radio on a weak
362 # PSU can reset the Pi; None when healthy.

Callers 1

_rusense_check_onceFunction · 0.85

Calls 2

_rusense_getFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected