Updated weather to get a locationID

This commit is contained in:
mochman
2016-05-25 15:23:29 -05:00
parent 93abaed0c2
commit b45899bf90
3 changed files with 14 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ Module.register("currentweather",{
// Default module config.
defaults: {
location: "",
locationID: "",
appid: "",
units: config.units,
updateInterval: 10 * 60 * 1000, // every 10 minutes
@@ -198,7 +199,11 @@ Module.register("currentweather",{
*/
getParams: function() {
var params = "?";
params += "q=" + this.config.location;
if(this.config.locationID !== "") {
params += "id=" + this.config.locationID;
} else {
params += "q=" + this.config.location;
}
params += "&units=" + this.config.units;
params += "&lang=" + this.config.lang;
params += "&APPID=" + this.config.appid;