mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
commit
7df48870df
@ -41,6 +41,7 @@ var config = {
|
|||||||
position: 'top_right',
|
position: 'top_right',
|
||||||
config: {
|
config: {
|
||||||
location: 'New York',
|
location: 'New York',
|
||||||
|
locationID: '', //ID from bulk.openweather.org/sample/
|
||||||
appid: 'YOUR_OPENWEATHER_API_KEY'
|
appid: 'YOUR_OPENWEATHER_API_KEY'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -50,6 +51,7 @@ var config = {
|
|||||||
header: 'Weather Forecast',
|
header: 'Weather Forecast',
|
||||||
config: {
|
config: {
|
||||||
location: 'New York',
|
location: 'New York',
|
||||||
|
locationID: '5128581', //ID from bulk.openweather.org/sample/
|
||||||
appid: 'YOUR_OPENWEATHER_API_KEY'
|
appid: 'YOUR_OPENWEATHER_API_KEY'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -14,6 +14,7 @@ modules: [
|
|||||||
config: {
|
config: {
|
||||||
// See 'Configuration options' for more information.
|
// See 'Configuration options' for more information.
|
||||||
location: 'Amsterdam,Netherlands',
|
location: 'Amsterdam,Netherlands',
|
||||||
|
locationID: '', //Location ID from http://bulk.openweather.org/sample/
|
||||||
appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key.
|
appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -34,7 +35,7 @@ The following properties can be configured:
|
|||||||
</tr>
|
</tr>
|
||||||
<thead>
|
<thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>location</code></td>
|
<td><code>location</code></td>
|
||||||
<td>The location used for weather information.<br>
|
<td>The location used for weather information.<br>
|
||||||
@ -42,6 +43,13 @@ The following properties can be configured:
|
|||||||
<br><b>Default value:</b> <code>New York</code>
|
<br><b>Default value:</b> <code>New York</code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>locationID</code></td>
|
||||||
|
<td>Location ID from <a href="http://bulk.openweather.org/sample/">OpenWeather</a> <b>This will override anything you put in location.</b><br>Leave blank if you want to use location.
|
||||||
|
<br><b>Example:</b> <code>1234567</code>
|
||||||
|
<br><b>Default value:</b> <code></code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>appid</code></td>
|
<td><code>appid</code></td>
|
||||||
<td>The <a href="https://home.openweathermap.org" target="_blank">OpenWeatherMap</a> API key, which can be obtained by creating an OpenWeatherMap account.<br>
|
<td>The <a href="https://home.openweathermap.org" target="_blank">OpenWeatherMap</a> API key, which can be obtained by creating an OpenWeatherMap account.<br>
|
||||||
|
@ -12,6 +12,7 @@ Module.register("currentweather",{
|
|||||||
// Default module config.
|
// Default module config.
|
||||||
defaults: {
|
defaults: {
|
||||||
location: "",
|
location: "",
|
||||||
|
locationID: "",
|
||||||
appid: "",
|
appid: "",
|
||||||
units: config.units,
|
units: config.units,
|
||||||
updateInterval: 10 * 60 * 1000, // every 10 minutes
|
updateInterval: 10 * 60 * 1000, // every 10 minutes
|
||||||
@ -198,7 +199,11 @@ Module.register("currentweather",{
|
|||||||
*/
|
*/
|
||||||
getParams: function() {
|
getParams: function() {
|
||||||
var params = "?";
|
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 += "&units=" + this.config.units;
|
||||||
params += "&lang=" + this.config.lang;
|
params += "&lang=" + this.config.lang;
|
||||||
params += "&APPID=" + this.config.appid;
|
params += "&APPID=" + this.config.appid;
|
||||||
|
@ -14,6 +14,7 @@ modules: [
|
|||||||
config: {
|
config: {
|
||||||
// See 'Configuration options' for more information.
|
// See 'Configuration options' for more information.
|
||||||
location: 'Amsterdam,Netherlands',
|
location: 'Amsterdam,Netherlands',
|
||||||
|
locationID: '', //Location ID from http://bulk.openweather.org/sample/
|
||||||
appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key.
|
appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,6 +43,13 @@ The following properties can be configured:
|
|||||||
<br><b>Default value:</b> <code>New York</code>
|
<br><b>Default value:</b> <code>New York</code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>locationID</code></td>
|
||||||
|
<td>Location ID from <a href="http://bulk.openweather.org/sample/">OpenWeather</a> <b>This will override anything you put in location.</b><br>Leave blank if you want to use location.
|
||||||
|
<br><b>Example:</b> <code>1234567</code>
|
||||||
|
<br><b>Default value:</b> <code></code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>appid</code></td>
|
<td><code>appid</code></td>
|
||||||
<td>The <a href="https://home.openweathermap.org" target="_blank">OpenWeatherMap</a> API key, which can be obtained by creating an OpenWeatherMap account.<br>
|
<td>The <a href="https://home.openweathermap.org" target="_blank">OpenWeatherMap</a> API key, which can be obtained by creating an OpenWeatherMap account.<br>
|
||||||
|
@ -12,6 +12,7 @@ Module.register("weatherforecast",{
|
|||||||
// Default module config.
|
// Default module config.
|
||||||
defaults: {
|
defaults: {
|
||||||
location: "",
|
location: "",
|
||||||
|
locationID: "",
|
||||||
appid: "",
|
appid: "",
|
||||||
units: config.units,
|
units: config.units,
|
||||||
maxNumberOfDays: 7,
|
maxNumberOfDays: 7,
|
||||||
@ -195,7 +196,11 @@ Module.register("weatherforecast",{
|
|||||||
*/
|
*/
|
||||||
getParams: function() {
|
getParams: function() {
|
||||||
var params = "?";
|
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 += "&units=" + this.config.units;
|
||||||
params += "&lang=" + this.config.lang;
|
params += "&lang=" + this.config.lang;
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user