From 2985a62d7d16f24877ae7490e858974530e6911d Mon Sep 17 00:00:00 2001 From: ztimson Date: Tue, 23 Jun 2026 23:36:57 -0400 Subject: [PATCH] Changed accumulation metric names --- sensors/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sensors/main.py b/sensors/main.py index 2134068..bf18310 100644 --- a/sensors/main.py +++ b/sensors/main.py @@ -383,8 +383,9 @@ def read_luna(c, temp_c): if strength < 100 or dist <= 0 or dist > c['LUNA_MAX_DIST_CM']: write(c, 'accumulation', null); return - fields = {'ground_distance': dist, 'lidar_strength': strength} + fields = {'ground_distance': dist, 'ground_calibration': luna_baseline_cm, 'lidar_strength': strength} + kind = 'none' if luna_baseline_cm and (luna_baseline_cm - dist) >= c['LUNA_MIN_DEPTH_CM']: t = temp_c depth = round(luna_baseline_cm - dist, 1) @@ -393,11 +394,10 @@ def read_luna(c, temp_c): 'slush' if t is not None and t > c['SLUSH_TEMP_THRESHOLD'] else 'snow' if strength > c['SNOW_STRENGTH_MIN'] else 'ice' ) - fields['ground_calibration'] = luna_baseline_cm fields['accumulation'] = depth - write(c, 'accumulation', fields, tags={'accumulation_type': kind}) else: - write(c, 'accumulation', fields) + fields['accumulation'] = 0 + write(c, 'accumulation', fields, tags={'accumulation_type': kind}) except Exception as e: print(f"[TF-Luna] {e}") write(c, 'accumulation', null)