From 504b27a834bc8ff1cf4603c7b83c3f6bf024a8da Mon Sep 17 00:00:00 2001 From: klaute Date: Wed, 25 Mar 2020 11:09:00 +0100 Subject: [PATCH] Fixed push call --- oko-weather/oko-weather-sync.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/oko-weather/oko-weather-sync.py b/oko-weather/oko-weather-sync.py index e3bf3ce..1cbccd0 100644 --- a/oko-weather/oko-weather-sync.py +++ b/oko-weather/oko-weather-sync.py @@ -52,15 +52,15 @@ def send_data_to_openweather(temp, hum, wind, pres, date): requests_log.setLevel(logging.DEBUG) requests_log.propagate = True - url = "/data/3.0/stations?appid=" + openweather_api_key + url = "/data/3.0/measurements?appid=" + openweather_api_key - data = '{"station_id":"' + openweather_station_id + '",' + \ - '"dt":"' + str(date) + '",' + \ - '"temperature":"' + str(temp) + '",' + \ - '"wind_speed":"' + str(wind) + '",' + \ - '"pressure":"' + str(pres) + '",' + \ - '"humidity":"' + str(hum) + '"' + \ - '}' + data = '[{"station_id":"' + openweather_station_id + '",' + \ + '"dt":' + str(date) + ',' + \ + '"temperature":' + str(temp) + ',' + \ + '"wind_speed":' + str(wind) + ',' + \ + '"pressure":' + str(pres) + ',' + \ + '"humidity":' + str(hum) + '' + \ + '}]' header = { "Content-Type" : "application/json" }