From de7393424060d18f50e2b0b04afd124cf1886744 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sat, 28 Oct 2023 18:14:41 -0400 Subject: [PATCH] attempt to resolve conflicts with migration path --- opensensor/collection_apis.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opensensor/collection_apis.py b/opensensor/collection_apis.py index f31ee0f..1c4c85e 100644 --- a/opensensor/collection_apis.py +++ b/opensensor/collection_apis.py @@ -54,14 +54,14 @@ "Moisture": "moisture_readings", } -column_translation = { +environment_translation = { "temp": "temp", "rh": "rh", "pressure": "pressure", - "percent": "lux", - "ppm": "ppm_CO2", + "lux": "lux", + "co2": "ppm_CO2", + "moisture": "moisture_readings", "pH": "pH", - "readings": "moisture_readings", } @@ -121,7 +121,7 @@ def _record_data_to_ts_collection( model_instance.pop("timestamp", None) # Translate to the combined collection field names - column_name = column_translation[column_name] + column_name = environment_translation[column_name] for key, value in model_instance.items(): if value is not None: