diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-02-02 11:19:38 -0800 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-02-11 19:44:43 -0800 |
commit | b1634e9c58a8442391aa782f967ddc3f85cd5cd9 (patch) | |
tree | cf8a9d62699a7d4b8094b2ce1e1a2560148aef79 /README.md | |
parent | 3da3a30f2e2261750d4e110c9b64447192dffd23 (diff) |
binding: weather: add initial openweathermap binding
Bug-AGL: SPEC-1273
Change-Id: Idf6f12148df840ad8cfe2c1bc8eb35c1bc759876
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..3c30616 --- /dev/null +++ b/README.md @@ -0,0 +1,71 @@ +# Weather Service + +## Overview + +Weather service uses current weather conditions from the OpenWeathermap webservice. + +## Verbs +| Name | Description | JSON Parameters | +|:----------------|:--------------------------------|:------------------------------------------------| +| subscribe | subscribe to media events | *Request:* {"value":"weather"} | +| unsubscribe | unsubscribe to media events | *Request:* {"value":"weather"} | +| api_key | get/set API key | *Request:* {"value": "openweather map api key"} | +| current_weather | get current weather conditions | See **current_weather Reporting** section | + + +### current_weather Reporting + +JSON Response is the current weather of the location detected from the geoclue service. + +OpenWeatherAPI Response API Documentation: *http://openweathermap.org/current* + +Example Response: +<pre> +{ + "coord": { + "lon": -122.63, + "lat": 45.64 + }, + "weather": [ + { + "id": 800, + "main": "Clear", + "description": "clear sky", + "icon": "01n" + } + ], + "base": "stations", + "main": { + "temp": 48.65, + "pressure": 1023, + "humidity": 76, + "temp_min": 44.6, + "temp_max": 51.8 + }, + "visibility": 16093, + "wind": { + "speed": 3.36, + "deg": 320 + }, + "clouds": { + "all": 1 + }, + "dt": 1517885760, + "sys": { + "type": 1, + "id": 2963, + "message": 0.0073, + "country": "US", + "sunrise": 1517930709, + "sunset": 1517966681 + }, + "id": 5814616, + "name": "Vancouver", + "cod": 200, + "url": "http:\/\/api.openweathermap.org\/data\/2.5\/weather?lat=45.6447&lon=-122.6298&units=imperial&APPID=a860fa437924aec3d0360cc749e25f0e" +} +</pre> + +### weather Event JSON Response + +JSON response for this event has the same results as documented in **current_weather** section. |