Add authenticated WiFi transport with BLE fallback

This commit is contained in:
2026-10-01 14:32:18 +08:00
parent 071f06d365
commit f011d8357d
55 changed files with 6327 additions and 29 deletions
+5 -1
View File
@@ -869,13 +869,17 @@ def create_app(
mobile = MobileControl(control, network, templates, animations, resolve_content,
apply_resolved_content, effective_default_content, set_default_content,
read_device_status, storage_monitor.get_status, library_order=library_order)
mobile_sessions = SessionManager(mobile.dispatch, mobile.identity)
mobile_sessions = SessionManager(mobile.dispatch, mobile.identity,
wifi_address=lambda: network.get_cached_status().get("active", {}).get("ipv4_address")
if network.get_cached_status().get("active", {}).get("connected") else None)
mobile_runtime = BluezRuntime(mobile_sessions, enabled=os.environ.get("MATRIX_BLE_ENABLED") == "1")
app.state.mobile_control = mobile
app.state.mobile_sessions = mobile_sessions
except Exception:
logger.exception("Mobile control initialization failed; display remains available")
app.state.mobile_runtime = mobile_runtime
from app.mobile.wifi import install_wifi_route
install_wifi_route(app)
@app.get("/api/status")
def get_status() -> dict: