From d6825eb9d93882cdc54f191d51eb66ba6369a463 Mon Sep 17 00:00:00 2001 From: Mikkeli Matlock Date: Mon, 26 Jan 2026 18:14:14 +0900 Subject: [PATCH] backend stub rpm behaviour changed to incremental --- pi/backend/arduino_service.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pi/backend/arduino_service.py b/pi/backend/arduino_service.py index ce0364d..fc8347b 100644 --- a/pi/backend/arduino_service.py +++ b/pi/backend/arduino_service.py @@ -229,15 +229,21 @@ class ArduinoService: """Fake data for testing without Arduino connected.""" import random + _rpm = 3000 + while self._running: self._connected = True data = { "time": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), "voltage": round(12.0 + random.uniform(-0.5, 0.8), 2), - "rpm": random.randint(800, 6000) if random.random() > 0.3 else None, + "rpm": _rpm if random.random() > 0.1 else None, "eng_temp": random.randint(60, 95), "gear": random.randint(1, 6) if random.random() > 0.2 else 0, # 0 = neutral } + _rpm += 10 + if _rpm > 7500: + _rpm = 500 + with self._lock: self._latest = data self._buffer.append(data)