Commit 7df88ada authored by Cédric Crettaz's avatar Cédric Crettaz 🖥

Update app.py for DVM and DCA Carouge weather.

parent 9b71ab1e
......@@ -26,7 +26,8 @@ logger = logging.getLogger()
URL_weather_service = 'https://www.prevision-meteo.ch/services/json/carouge'
COLLECTION_DIR = os.getenv('COLLECTION_DIR', default='raw_data')
DEFAULT_MERGED_DATE_FILEPATH= os.path.join(COLLECTION_DIR, "merged.json")
URL_BASE = 'http://{}:1026'.format(os.getenv('ORION_HOST', default='localhost'))
#URL_BASE = 'http://{}:1026'.format(os.getenv('ORION_HOST', default='localhost'))
URL_BASE = 'http://{}:5002'.format(os.getenv('DATA_MODEL_VALIDATION', default='localhost'))
POST_DATA_PERIOD = int(os.getenv('POST_DATA_PERIOD', default='1800')) # in seconds
# URN
......@@ -135,7 +136,8 @@ def update_weather_observed_entity(entity):
entity.pop('id')
entity.pop('type')
url = "{}/v2/entities/{}/attrs".format(URL_BASE, URN_WEATHER_ENTITY)
#url = "{}/v2/entities/{}/attrs".format(URL_BASE, URN_WEATHER_ENTITY)
url = "{}/validation/v2/entities/{}/attrs".format(URL_BASE, URN_WEATHER_ENTITY)
r = client_request.patch(
url=url,
headers=http_header_post,
......
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