Browse Source

Fixed push call

klaute 7 months ago
parent
commit
504b27a834
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      oko-weather/oko-weather-sync.py

+ 9
- 9
oko-weather/oko-weather-sync.py View File

@@ -52,15 +52,15 @@ def send_data_to_openweather(temp, hum, wind, pres, date):
52 52
     requests_log.setLevel(logging.DEBUG)
53 53
     requests_log.propagate = True
54 54
 
55
-    url = "/data/3.0/stations?appid=" + openweather_api_key
56
-
57
-    data = '{"station_id":"' + openweather_station_id + '",' + \
58
-             '"dt":"' + str(date) + '",' + \
59
-             '"temperature":"' + str(temp) + '",' + \
60
-             '"wind_speed":"' + str(wind) + '",' + \
61
-             '"pressure":"' + str(pres) + '",' + \
62
-             '"humidity":"' + str(hum) + '"' + \
63
-           '}'
55
+    url = "/data/3.0/measurements?appid=" + openweather_api_key
56
+
57
+    data = '[{"station_id":"' + openweather_station_id + '",' + \
58
+             '"dt":' + str(date) + ',' + \
59
+             '"temperature":' + str(temp) + ',' + \
60
+             '"wind_speed":' + str(wind) + ',' + \
61
+             '"pressure":' + str(pres) + ',' + \
62
+             '"humidity":' + str(hum) + '' + \
63
+           '}]'
64 64
 
65 65
     header = { "Content-Type" : "application/json" }
66 66
 

Loading…
Cancel
Save