node-red-node-openweathermap
Advanced tools
Comparing version 0.0.3 to 0.1.0
{ | ||
"name" : "node-red-node-openweathermap", | ||
"version" : "0.0.3", | ||
"version" : "0.1.0", | ||
"description" : "A Node-RED node that gets the weather report from openweathermap", | ||
@@ -5,0 +5,0 @@ "dependencies" : { |
@@ -29,3 +29,3 @@ /** | ||
} else { | ||
node.error("Invalid lat provided",msg); | ||
node.error(RED._("weather.error.invalid-lat"),msg); | ||
return; | ||
@@ -36,3 +36,3 @@ } | ||
} else { | ||
node.error("Invalid lon provided",msg); | ||
node.error(RED._("weather.error.invalid-lon"),msg); | ||
return; | ||
@@ -60,3 +60,3 @@ } | ||
if (url) { | ||
node.status({fill:"blue",shape:"dot",text:"requesting"}); | ||
node.status({fill:"blue",shape:"dot",text:"weather.status.requesting"}); | ||
http.get(url, function(res) { | ||
@@ -73,3 +73,3 @@ var weather = ""; | ||
} catch (e) { | ||
callback("The API call returned invalid JSON"); | ||
callback(RED._("weather.error.invalid-json")); | ||
return; | ||
@@ -98,9 +98,9 @@ } | ||
if (jsun.hasOwnProperty("dt")) { msg.time = new Date(jsun.dt*1000); } | ||
msg.title = "Current Weather Information"; | ||
msg.description = "Current weather information at coordinates: " + msg.location.lat + ", " + msg.location.lon; | ||
msg.payload.description = ("The weather in " + jsun.name + " at coordinates: " + jsun.coord.lat + ", " + jsun.coord.lon + " is " + jsun.weather[0].main + " (" + jsun.weather[0].description + ")." ); | ||
msg.title = RED._("weather.message.title"); | ||
msg.description = RED._("weather.message.description", {lat: msg.location.lat, lon: msg.location.lon}); | ||
msg.payload.description = (RED._("weather.message.payload", {name: jsun.name, lat: jsun.coord.lat, lon: jsun.coord.lon, main: jsun.weather[0].main, description: jsun.weather[0].description})); | ||
callback(); | ||
} else { | ||
if (jsun.message === "Error: Not found city") { | ||
callback("Invalid city/country"); | ||
callback(RED._("weather.error.invalid-city_country")); | ||
return; | ||
@@ -120,3 +120,3 @@ } else { | ||
} else { | ||
callback("Invalid location information provided"); | ||
callback(RED._("weather.error.invalid-location")); | ||
} | ||
@@ -123,0 +123,0 @@ } |
Sorry, the diff of this file is not supported yet
36937
7
227