Commit 58c2c908 authored by Federico Sismondi's avatar Federico Sismondi

Add wtp_lab entities, and homogenized log formatting

parent 5d62ab97
......@@ -21,13 +21,14 @@ import time
import requests
import dateutil.parser
import datetime
import logging
from geojson import Point
from flask import Flask, jsonify
from flask import request
import requests as client_request
app = Flask(__name__, )
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')
# get config from environment
COLLECTION_DIR = os.getenv('COLLECTION_DIR', default='raw_data')
......
......@@ -138,24 +138,24 @@ attrs = {
entities = [
# weather prediction use case - weather observed (current)
('urn:ngsi-ld:WeatherObserved:WeatherObserved', ['carouge', 'braila']),
('urn:ngsi-ld:WeatherObserved:WeatherObserved', ['carouge', 'braila', 'wtp_lab']),
('urn:ngsi-ld:WeatherObserved:WeatherObserved-1', ['alicante']),
('urn:ngsi-ld:WeatherObserved:WeatherObserved-2', ['alicante']),
# forecast today
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day0-0', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day0-1', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day0-2', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day0-3', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day0-0', ['carouge', 'alicante', 'braila','wtp_lab']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day0-1', ['carouge', 'alicante', 'braila','wtp_lab']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day0-2', ['carouge', 'alicante', 'braila','wtp_lab']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day0-3', ['carouge', 'alicante', 'braila','wtp_lab']),
# forecast tomorrow
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day1-0', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day1-1', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day1-2', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day1-3', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day1-0', ['carouge', 'alicante', 'braila','wtp_lab']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day1-1', ['carouge', 'alicante', 'braila','wtp_lab']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day1-2', ['carouge', 'alicante', 'braila','wtp_lab']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day1-3', ['carouge', 'alicante', 'braila','wtp_lab']),
# forecast tomorrow
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day2-0', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day2-1', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day2-2', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day2-3', ['carouge', 'alicante', 'braila']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day2-0', ['carouge', 'alicante', 'braila','wtp_lab']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day2-1', ['carouge', 'alicante', 'braila','wtp_lab']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day2-2', ['carouge', 'alicante', 'braila','wtp_lab']),
('urn:ngsi-ld:WeatherForecast:WeatherForecast-Day2-3', ['carouge', 'alicante', 'braila','wtp_lab']),
# watering use case - flower beds
('urn:ngsi-ld:FlowerBed:FlowerBed-1', ['carouge']),
......@@ -176,6 +176,9 @@ entities = [
("urn:ngsi-ld:WaterQualityObserved:WaterTreatmentPlant", ['wtp_lab']),
("urn:ngsi-ld:WaterQualityForecast:WaterTreatmentPlant", ['wtp_lab']),
# weather use case wtp_lab
('urn:ngsi-ld:WeatherObserved:WeatherObserved', ['carouge', 'braila']),
]
# http headers
......
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