node-red-node-openweathermap
Advanced tools
Comparing version 0.1.11 to 0.1.12
@@ -15,3 +15,23 @@ { | ||
"longitude": "Longitude", | ||
"apikey": "API Key" | ||
"apikey": "API Key", | ||
"language": "Language", | ||
"option_lang_en": "English", | ||
"option_lang_ru": "Russian", | ||
"option_lang_it": "Italian", | ||
"option_lang_es": "Spanish", | ||
"option_lang_uk": "Ukrainian", | ||
"option_lang_de": "German", | ||
"option_lang_pt": "Portuguese", | ||
"option_lang_ro": "Romanian", | ||
"option_lang_pl": "Polish", | ||
"option_lang_fi": "Finnish", | ||
"option_lang_nl": "Dutch", | ||
"option_lang_fr": "French", | ||
"option_lang_bg": "Bulgarian", | ||
"option_lang_sv": "Swedish", | ||
"option_lang_zh_tw": "Chinese Traditional", | ||
"option_lang_zh": "Chinese Simplified", | ||
"option_lang_tr": "Turkish", | ||
"option_lang_hr": "Croatian", | ||
"option_lang_ca": "Catalan" | ||
}, | ||
@@ -18,0 +38,0 @@ "placeholder": { |
{ | ||
"name" : "node-red-node-openweathermap", | ||
"version" : "0.1.11", | ||
"version" : "0.1.12", | ||
"description" : "A Node-RED node that gets the weather report from openweathermap", | ||
@@ -5,0 +5,0 @@ "dependencies" : { |
@@ -21,3 +21,3 @@ /** | ||
function assignmentFunction(node, msg, lat, lon, city, country, callback) { | ||
function assignmentFunction(node, msg, lat, lon, city, country, language, callback) { | ||
if (country && city) { | ||
@@ -39,3 +39,4 @@ node.country = country; | ||
} | ||
} | ||
} | ||
node.language = language || "en"; | ||
callback(); | ||
@@ -54,11 +55,11 @@ } | ||
if (node.lat && node.lon) { | ||
url = "http://api.openweathermap.org/data/2.5/forecast/daily?cnt=5&units=metric&lat=" + node.lat + "&lon=" + node.lon + "&APPID=" + node.credentials.apikey; | ||
url = "http://api.openweathermap.org/data/2.5/forecast/daily?lang=" + node.language + "&cnt=5&units=metric&lat=" + node.lat + "&lon=" + node.lon + "&APPID=" + node.credentials.apikey; | ||
} else if (node.city && node.country) { | ||
url = "http://api.openweathermap.org/data/2.5/forecast/daily?cnt=5&units=metric&q=" + node.city + "," + node.country + "&APPID=" + node.credentials.apikey; | ||
url = "http://api.openweathermap.org/data/2.5/forecast/daily?lang=" + node.language + "&cnt=5&units=metric&q=" + node.city + "," + node.country + "&APPID=" + node.credentials.apikey; | ||
} | ||
} else { | ||
if (node.lat && node.lon) { | ||
url = "http://api.openweathermap.org/data/2.5/weather?lat=" + node.lat + "&lon=" + node.lon + "&APPID=" + node.credentials.apikey; | ||
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.city && node.country) { | ||
url = "http://api.openweathermap.org/data/2.5/weather?q=" + node.city + "," + node.country + "&APPID=" + node.credentials.apikey; | ||
url = "http://api.openweathermap.org/data/2.5/weather?lang=" + node.language + "&q=" + node.city + "," + node.country + "&APPID=" + node.credentials.apikey; | ||
} | ||
@@ -155,2 +156,3 @@ } | ||
var country; | ||
var language; | ||
var lat; | ||
@@ -172,3 +174,4 @@ var lon; | ||
} | ||
assignmentFunction(node, msg, lat, lon, city, country, function() { | ||
language = n.language || "en"; | ||
assignmentFunction(node, msg, lat, lon, city, country, language, function() { | ||
weatherPoll(node, msg, function(err) { | ||
@@ -203,2 +206,3 @@ if (err) { | ||
var country; | ||
var language; | ||
var lat; | ||
@@ -224,3 +228,4 @@ var lon; | ||
} | ||
assignmentFunction(node, msg, lat, lon, city, country, function() { | ||
language = n.language || "en"; | ||
assignmentFunction(node, msg, lat, lon, city, country, language, function() { | ||
weatherPoll(node, msg, function(err) { | ||
@@ -227,0 +232,0 @@ if (err) { |
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
48672
294