docs: история 2026-06-10 — speed-test, адаптивный интервал, threading lock
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user