Commit fa8b0f1d authored by Cédric Crettaz's avatar Cédric Crettaz 🖥

Update app.py for the Dragino sensors.

parent a9975129
......@@ -609,8 +609,8 @@ def _update_flowerbed_entity(soil_moisture, sensor_eui):
def _update_flowerbed_entity_new(soil_moisture, soil_temperature, conductivity, sensor_eui):
flowerbed_id = None
# check if refDevice attr defined for any FlowerBed
url = "{}/v2/entities/?q=refDevice=={}&type=FlowerBed".format(URL_BASE, sensor_eui)
# check if refNewDevice attr defined for any FlowerBed
url = "{}/v2/entities/?q=refNewDevice=={}&type=FlowerBed".format(URL_BASE, sensor_eui)
r = client_request.get(
url=url,
headers=http_header_get
......@@ -725,7 +725,7 @@ def _update_historical_db_from_local_raw_files():
'soilMoisture': get_ngsiv2_typed_description(moist, json_data['timestamp']),
'soilTemperature': get_ngsiv2_typed_description(soil_temperature, json_data['timestamp']),
'soilMoistureEc': get_ngsiv2_typed_description(conductivity, json_data['timestamp']),
'refDevice': get_ngsiv2_typed_description(sensor_eui, json_data['timestamp']),
'refNewDevice': get_ngsiv2_typed_description(sensor_eui, json_data['timestamp']),
}
# add to list of data to be sent to quantum leap
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment