Skip to content

Commit

Permalink
add rain to openweathermap (#282)
Browse files Browse the repository at this point in the history
* add rain to openweathermap

* document rain field to openweathermap/README.md
  • Loading branch information
LolHens committed Jul 4, 2021
1 parent 69a22e7 commit 685bee7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions openweathermap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Current conditions will return
- **windspeed** - the current wind speed at the location in metres per second.
- **winddirection** - the current wind direction at the location in meteorological degrees.
- **location** - the name of the location from which the data was sourced.
- **rain** - the precipitation amount in mm/h (only present if it is raining).

5 day Forecast will return a 5 part array, each with

Expand Down
1 change: 1 addition & 0 deletions openweathermap/weather.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ module.exports = function(RED) {
msg.payload.sunrise = jsun.sys.sunrise;
msg.payload.sunset = jsun.sys.sunset;
msg.payload.clouds = jsun.clouds.all;
if (jsun.hasOwnProperty("rain")) { msg.payload.rain = jsun.rain["1h"]; }
if (jsun.hasOwnProperty("coord")) {
msg.location.lon = jsun.coord.lon;
msg.location.lat = jsun.coord.lat;
Expand Down

0 comments on commit 685bee7

Please sign in to comment.