Skip to content

Commit

Permalink
attempt to resolve conflicts with migration path
Browse files Browse the repository at this point in the history
  • Loading branch information
matteius committed Oct 28, 2023
1 parent a4e29ae commit de73934
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions opensensor/collection_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}


Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit de73934

Please sign in to comment.