Lower noise buffer for ultrasonic ranger
Build, push image, and notify Watchtower / build-image (push) Successful in 41s
Build, push image, and notify Watchtower / notify (push) Successful in 13s

This commit is contained in:
2026-08-23 11:05:04 +02:00
parent b0a6c4d2ec
commit c39b811a3c
+6 -6
View File
@@ -817,16 +817,16 @@ async def monitor_dish_height_task():
if dist is not None: if dist is not None:
# Hysteresis Thresholds: # Hysteresis Thresholds:
# - Must be > 2.5 cm to detect dish insertion # - Must be > 1.2 cm to detect dish insertion
# - Must be < 1.2 cm to detect dish removal # - Must be < 0.8 cm to detect dish removal
if dist > 2.5: if dist > 1.2:
consecutive_present += 1 consecutive_present += 1
consecutive_absent = 0 consecutive_absent = 0
elif dist < 1.2: elif dist < 0.8:
consecutive_absent += 1 consecutive_absent += 1
consecutive_present = 0 consecutive_present = 0
else: else:
# Dead-zone (1.2cm to 2.5cm) -> Noise buffer # Dead-zone (1.2cm to 0.8cm) -> Noise buffer
consecutive_present = 0 consecutive_present = 0
consecutive_absent = 0 consecutive_absent = 0
@@ -848,7 +848,7 @@ async def monitor_dish_height_task():
ir_data_cache.pop(mw_id, None) ir_data_cache.pop(mw_id, None)
ir_data_events.pop(mw_id, None) ir_data_events.pop(mw_id, None)
await asyncio.sleep(0.3) await asyncio.sleep(0.7)
# --- BOOTSTRAP --- # --- BOOTSTRAP ---
async def main(): async def main():