Commit 1da9b346 authored by Cédric Crettaz's avatar Cédric Crettaz 🖥

Update app.py for the attribute deviceState.

parent 2b550dd1
......@@ -515,7 +515,7 @@ def get_model_device(deveui,
body.update({'controlledProperty': get_ngsiv2_typed_description(['soil_moisture'], meta_datetime)})
body.update({'owner': get_ngsiv2_typed_description('Carouge', meta_datetime)})
body.update({'source': get_ngsiv2_typed_description(LORA_PLATFORM_URL, meta_datetime)})
body.update({'deviceState': get_ngsiv2_typed_description('active', meta_datetime)})
#body.update({'deviceState': get_ngsiv2_typed_description('active', meta_datetime)})
# dynamic/real-time values
if longitude and latitude:
......@@ -555,6 +555,7 @@ def get_model_device(deveui,
body.update({'value': get_ngsiv2_typed_description(moist, meta_datetime)})
body.update({'batteryLevel': get_ngsiv2_typed_description(bat, meta_datetime)})
body.update({'moistureUnit': get_ngsiv2_typed_description('cb', meta_datetime)})
body.update({'deviceState': get_ngsiv2_typed_description('active', meta_datetime)})
if deveui.startswith('a840') :
bat, moist, soil_temperature, conductivity = _get_reading_new(dataFrame)
body.update({'batteryLevel': get_ngsiv2_typed_description(bat, meta_datetime)})
......@@ -562,6 +563,7 @@ def get_model_device(deveui,
body.update({'soilTemperature': get_ngsiv2_typed_description(soil_temperature, meta_datetime)})
body.update({'soilMoistureEc': get_ngsiv2_typed_description(conductivity, meta_datetime)})
body.update({'moistureUnit': get_ngsiv2_typed_description('percent', meta_datetime)})
body.update({'deviceState': get_ngsiv2_typed_description('active', meta_datetime)})
if dataFrame_rssi:
body.update({'rssi': get_ngsiv2_typed_description(dataFrame_rssi, meta_datetime)})
......
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