From cd1c0a977e12af9dab2b2d87f38624a43303f165 Mon Sep 17 00:00:00 2001 From: Repinoid Date: Sun, 28 Jun 2026 19:35:47 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20hello=20=D1=87=D0=B8=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D1=82=20=D1=81=D1=82=D0=B0=D1=80=D1=8B=D0=B5=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20=D0=B4=D0=BB=D1=8F=20device=5F?= =?UTF-8?q?id=20=E2=80=94=20=D0=BD=D0=BE=D0=B2=D0=B0=D1=8F=20=D1=81=D0=B5?= =?UTF-8?q?=D1=81=D1=81=D0=B8=D1=8F=20=3D=20=D1=87=D0=B8=D1=81=D1=82=D1=8B?= =?UTF-8?q?=D0=B9=20=D1=81=D1=82=D0=B0=D1=80=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/raw_elm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/raw_elm.py b/api/raw_elm.py index 11be7e1..7c7bcad 100644 --- a/api/raw_elm.py +++ b/api/raw_elm.py @@ -150,6 +150,10 @@ def raw_hello(): """Android: «я подключился, готов принимать команды».""" data = request.get_json(silent=True) or {} device_id = data.get("device_id", "unknown") + with Database() as db: + # Очистить старые команды для этого устройства (новая сессия) + db.conn.execute("DELETE FROM command_queue WHERE device_id = ?", (device_id,)) + db.conn.commit() logger.info(f"RawELM: device ready — {device_id} " f"({data.get('elm_version', '?')}, proto {data.get('protocol', '?')})") return jsonify({"ok": True, "seq": 0})