node-red-node-openweathermap
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -9,2 +9,3 @@ { | ||
"option_5dayforecast": "5 day forecast for", | ||
"option_onecall": "combined current weather/forecast for", | ||
"option_city": "City, Country", | ||
@@ -11,0 +12,0 @@ "option_coordinates": "Coordinates", |
{ | ||
"name": "node-red-node-openweathermap", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "A Node-RED node that gets the weather report from openweathermap", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -58,3 +58,3 @@ /** | ||
} | ||
} else { | ||
} else if (node.wtype === "current") { | ||
if (node.lat && node.lon) { | ||
@@ -65,2 +65,6 @@ url = "http://api.openweathermap.org/data/2.5/weather?lang=" + node.language + "&lat=" + node.lat + "&lon=" + node.lon + "&APPID=" + node.credentials.apikey; | ||
} | ||
} else if (node.wtype === "onecall") { | ||
if (node.lat && node.lon) { | ||
url = "https://api.openweathermap.org/data/2.5/onecall?lang=" + node.language + "&lat=" + node.lat + "&lon=" + node.lon + "&units=metric&APPID=" + node.credentials.apikey; | ||
} | ||
} | ||
@@ -133,2 +137,12 @@ | ||
callback(); | ||
} else if(jsun.hasOwnProperty("current") && jsun.hasOwnProperty("hourly") && jsun.hasOwnProperty("daily")) { | ||
msg.payload.current = jsun.current; | ||
msg.payload.hourly = jsun.hourly; | ||
msg.payload.daily = jsun.daily; | ||
if(jsun.hasOwnProperty('minutely')) { | ||
msg.payload.minutely = jsun.minutely; | ||
} | ||
msg.location.lat = jsun.lat; | ||
msg.location.lon = jsun.lon; | ||
callback(); | ||
} else { | ||
@@ -135,0 +149,0 @@ if (jsun.message === "Error: Not found city") { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55063
338