Commit 0a6024fc authored by Federico Sismondi's avatar Federico Sismondi
Browse files

Fixes() for DCA watering and DCA weather use cases

parent 00b9412d
......@@ -143,7 +143,7 @@ def _forward_to_message_broker():
entity_id, street_address = mapping_deveui_to_fiware_instance_meta[dev_eui]
_log_level_of_moisture(sensor_reading, entity_id)
app.logger.info("Forwarding IoT reading ({}) to IoT platform entity: {}".format(sensor_reading, entity_id))
app.logger.info("Forwarding IoT reading to IoT platform (entity {})".format(entity_id))
url = "{}/v2/entities/{}/attrs?options=keyValues".format(URL_BASE, entity_id)
payload = {
'boxId': entity_id.split('-')[-1],
......@@ -220,9 +220,9 @@ def post_dca_carouge_watering_sensed_data_payload():
return resp
@app.route('/dca-carouge-watering-sensed-data/rest/callback/nodeinfo', methods=['POST'])
def post_dca_carouge_watering_sensed_node_info():
print(request.json)
@app.route('/dca-carouge-watering-sensed-data/rest/callback/nodeinfo', methods=['PUT'])
def put_dca_carouge_watering_sensed_node_info():
_dummy_post_handler()
raise InvalidUsage(message='This is still not implemented', payload=request.json)
......@@ -238,3 +238,4 @@ def get_dca_carouge_watering_sensed_data_callback():
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True, port=80)
......@@ -55,7 +55,7 @@ def get_data_from_weather_service():
url=URL_weather_service,
timeout=90,
)
except (requests.exceptions.ConnectTimeout, requests.exceptions.ConnectionError):
except (requests.exceptions.ReadTimeout, requests.exceptions.ConnectTimeout, requests.exceptions.ConnectionError):
logger.info('Could not weather reach service')
return None
try:
......
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