Commit 4b256ec2 authored by Federico Sismondi's avatar Federico Sismondi

Fix() issue using python request api

parent 0ab5e317
......@@ -132,17 +132,17 @@ def _log_level_of_moisture(cb, sensor):
"""
if cb < 10:
app.logger.warning("{} indicates soil is saturated wet - {} cb!".format(sensor, cb))
app.logger.warning("{} indicates soil is saturated wet: {} cb!".format(sensor, cb))
elif cb < 30:
app.logger.info("{} indicates soil is adequately wet - {} cb".format(sensor, cb))
app.logger.info("{} indicates soil is adequately wet: {} cb".format(sensor, cb))
elif cb < 60:
app.logger.info("{} indicates soil in usual range of irrigation for moist soils - {} cb".format(sensor, cb))
app.logger.info("{} indicates soil in usual range of irrigation for moist soils: {} cb".format(sensor, cb))
elif cb < 100:
app.logger.warning("{} indicates soil needs irrigation - {} cb".format(sensor, cb))
app.logger.warning("{} indicates soil needs irrigation: {} cb".format(sensor, cb))
elif cb < 200:
app.logger.warning("{} indicates soil is dangerously dry - {} cb".format(sensor, cb))
app.logger.warning("{} indicates soil is dangerously dry: {} cb".format(sensor, cb))
else:
app.logger.error("Measurement not in expected range - {} cb".format(cb))
app.logger.error("Measurement not in expected range: {} cb".format(cb))
def _conv_micro_volts_to_moiture_cb(micro_volts):
......@@ -212,7 +212,7 @@ def _update_flowerbed_entity(soil_moisture, sensor_eui):
r = client_request.patch(
url=url,
headers=http_header_post,
payload={
json={
"soilMoisture": get_ngsiv2_typed_description(soil_moisture)
}
)
......
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