mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 12:12:20 +00:00
currentweather: add option onlyTemp.
Is added option onlyTemp for show only current temperature and weather icon.
This commit is contained in:
parent
e5c75259e0
commit
2ea7ef327e
@ -113,6 +113,13 @@ The following properties can be configured:
|
|||||||
<br><b>Default value:</b> <code>false</code>
|
<br><b>Default value:</b> <code>false</code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>onlyTemp</code></td>
|
||||||
|
<td>Show only current Temperature and weather icon.<br>
|
||||||
|
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
||||||
|
<br><b>Default value:</b> <code>false</code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>useBeaufort</code></td>
|
<td><code>useBeaufort</code></td>
|
||||||
<td>Pick between using the Beaufort scale for wind speed or using the default units.<br>
|
<td>Pick between using the Beaufort scale for wind speed or using the default units.<br>
|
||||||
|
@ -35,6 +35,8 @@ Module.register("currentweather",{
|
|||||||
appendLocationNameToHeader: true,
|
appendLocationNameToHeader: true,
|
||||||
calendarClass: "calendar",
|
calendarClass: "calendar",
|
||||||
|
|
||||||
|
onlyTemp: false,
|
||||||
|
|
||||||
iconTable: {
|
iconTable: {
|
||||||
"01d": "wi-day-sunny",
|
"01d": "wi-day-sunny",
|
||||||
"02d": "wi-day-cloudy",
|
"02d": "wi-day-cloudy",
|
||||||
@ -100,21 +102,9 @@ Module.register("currentweather",{
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Override dom generator.
|
// add extra information of current weather
|
||||||
getDom: function() {
|
// windDirection, humidity, sunrise and sunset
|
||||||
var wrapper = document.createElement("div");
|
addExtraInfoWeather: function(wrapper) {
|
||||||
|
|
||||||
if (this.config.appid === "") {
|
|
||||||
wrapper.innerHTML = "Please set the correct openweather <i>appid</i> in the config for module: " + this.name + ".";
|
|
||||||
wrapper.className = "dimmed light small";
|
|
||||||
return wrapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.loaded) {
|
|
||||||
wrapper.innerHTML = this.translate('LOADING');
|
|
||||||
wrapper.className = "dimmed light small";
|
|
||||||
return wrapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
var small = document.createElement("div");
|
var small = document.createElement("div");
|
||||||
small.className = "normal medium";
|
small.className = "normal medium";
|
||||||
@ -162,6 +152,27 @@ Module.register("currentweather",{
|
|||||||
small.appendChild(sunriseSunsetTime);
|
small.appendChild(sunriseSunsetTime);
|
||||||
|
|
||||||
wrapper.appendChild(small);
|
wrapper.appendChild(small);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Override dom generator.
|
||||||
|
getDom: function() {
|
||||||
|
var wrapper = document.createElement("div");
|
||||||
|
|
||||||
|
if (this.config.appid === "") {
|
||||||
|
wrapper.innerHTML = "Please set the correct openweather <i>appid</i> in the config for module: " + this.name + ".";
|
||||||
|
wrapper.className = "dimmed light small";
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.loaded) {
|
||||||
|
wrapper.innerHTML = this.translate('LOADING');
|
||||||
|
wrapper.className = "dimmed light small";
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.config.onlyTemp === false) {
|
||||||
|
this.addExtraInfoWeather(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
var large = document.createElement("div");
|
var large = document.createElement("div");
|
||||||
large.className = "large light";
|
large.className = "large light";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user