docs: история 2026-06-10 — speed-test, адаптивный интервал, threading lock

This commit is contained in:
Repinoid
2026-06-10 20:13:11 +04:00
parent 008b1c11b5
commit 74808332be
4 changed files with 192 additions and 17 deletions
+13
View File
@@ -316,6 +316,19 @@ def register(app):
return jsonify(p)
@app.route("/api/v1/elm/profile/<mac>", methods=["PUT"])
def update_elm_profile(mac: str):
"""Обновляет поля профиля (response_time_ms, elm_desc и т.д.)."""
data = request.get_json(silent=True) or {}
with Database() as db:
p = db.get_device_profile(mac)
if p is None:
return jsonify({"error": "not found"}), 404
p.update(data)
_save_profile(mac, p)
return jsonify({"ok": True})
def _save_profile(mac: str, profile: dict):
"""Сохраняет профиль в БД (best-effort)."""
try: