Browse Source

Fixed json

klaute 7 months ago
parent
commit
44a528467a
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      oko-weather/oko-weather-sync.py

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

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

Loading…
Cancel
Save