mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-12-12 09:52:37 +00:00
currentweather, weatherforecast: fix locationID empty
Fix when the option locationID the value = ''
If you have the next config
config: {
// See 'Configuration options' for more information.
location: 'Chillan, Chile',
locationID: '',
appid: 'abcde12345abcde12345abcde12345ab'
}
The modules dont get the data, because the parameters of query is created
in id=''
This commit is contained in:
committed by
Rodrigo Ramírez Norambuena
parent
89c0939d58
commit
2f6e650c1b
@@ -259,9 +259,9 @@ Module.register("currentweather",{
|
|||||||
*/
|
*/
|
||||||
getParams: function() {
|
getParams: function() {
|
||||||
var params = "?";
|
var params = "?";
|
||||||
if(this.config.locationID !== false) {
|
if(this.config.locationID) {
|
||||||
params += "id=" + this.config.locationID;
|
params += "id=" + this.config.locationID;
|
||||||
} else if(this.config.location !== false) {
|
} else if(this.config.location) {
|
||||||
params += "q=" + this.config.location;
|
params += "q=" + this.config.location;
|
||||||
} else if (this.firstEvent && this.firstEvent.geo) {
|
} else if (this.firstEvent && this.firstEvent.geo) {
|
||||||
params += "lat=" + this.firstEvent.geo.lat + "&lon=" + this.firstEvent.geo.lon
|
params += "lat=" + this.firstEvent.geo.lat + "&lon=" + this.firstEvent.geo.lon
|
||||||
|
|||||||
@@ -249,9 +249,9 @@ Module.register("weatherforecast",{
|
|||||||
*/
|
*/
|
||||||
getParams: function() {
|
getParams: function() {
|
||||||
var params = "?";
|
var params = "?";
|
||||||
if(this.config.locationID !== false) {
|
if(this.config.locationID) {
|
||||||
params += "id=" + this.config.locationID;
|
params += "id=" + this.config.locationID;
|
||||||
} else if(this.config.location !== false) {
|
} else if(this.config.location) {
|
||||||
params += "q=" + this.config.location;
|
params += "q=" + this.config.location;
|
||||||
} else if (this.firstEvent && this.firstEvent.geo) {
|
} else if (this.firstEvent && this.firstEvent.geo) {
|
||||||
params += "lat=" + this.firstEvent.geo.lat + "&lon=" + this.firstEvent.geo.lon
|
params += "lat=" + this.firstEvent.geo.lat + "&lon=" + this.firstEvent.geo.lon
|
||||||
|
|||||||
Reference in New Issue
Block a user