mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 04:02:12 +00:00
Add in degree label to solve issue #753
This commit is contained in:
parent
d26d94b62a
commit
3c60feed02
@ -49,6 +49,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Korean Translation.
|
- Korean Translation.
|
||||||
- Added console warning on startup when deprecated config options are used
|
- Added console warning on startup when deprecated config options are used
|
||||||
- Added `DAYAFTERTOMORROW`, `UPDATE_NOTIFICATION`, `UPDATE_NOTIFICATION_MODULE`, `UPDATE_INFO` to Norwegian translations (`nn` and `nb`).
|
- Added `DAYAFTERTOMORROW`, `UPDATE_NOTIFICATION`, `UPDATE_NOTIFICATION_MODULE`, `UPDATE_INFO` to Norwegian translations (`nn` and `nb`).
|
||||||
|
- Add option to display temperature unit label
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Update .gitignore to not ignore default modules folder.
|
- Update .gitignore to not ignore default modules folder.
|
||||||
|
@ -33,6 +33,7 @@ The following properties can be configured:
|
|||||||
| `appid` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account. <br><br> This value is **REQUIRED**
|
| `appid` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account. <br><br> This value is **REQUIRED**
|
||||||
| `units` | What units to use. Specified by config.js <br><br> **Possible values:** `config.units` = Specified by config.js, `default` = Kelvin, `metric` = Celsius, `imperial` =Fahrenheit <br> **Default value:** `config.units`
|
| `units` | What units to use. Specified by config.js <br><br> **Possible values:** `config.units` = Specified by config.js, `default` = Kelvin, `metric` = Celsius, `imperial` =Fahrenheit <br> **Default value:** `config.units`
|
||||||
| `roundTemp` | Round temperature value to nearest integer. <br><br> **Possible values:** `true` (round to integer) or `false` (display exact value with decimal point) <br> **Default value:** `false`
|
| `roundTemp` | Round temperature value to nearest integer. <br><br> **Possible values:** `true` (round to integer) or `false` (display exact value with decimal point) <br> **Default value:** `false`
|
||||||
|
| `degreeLabel` | Show the degree label for your chosen units (Metric = C, Imperial = F, Kelvins = K). <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
| `updateInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `600000` (10 minutes)
|
| `updateInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `600000` (10 minutes)
|
||||||
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `1000` (1 second)
|
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `1000` (1 second)
|
||||||
| `timeFormat` | Use 12 or 24 hour format. <br><br> **Possible values:** `12` or `24` <br> **Default value:** uses value of _config.timeFormat_
|
| `timeFormat` | Use 12 or 24 hour format. <br><br> **Possible values:** `12` or `24` <br> **Default value:** uses value of _config.timeFormat_
|
||||||
|
@ -24,6 +24,7 @@ Module.register("currentweather",{
|
|||||||
useBeaufort: true,
|
useBeaufort: true,
|
||||||
lang: config.language,
|
lang: config.language,
|
||||||
showHumidity: false,
|
showHumidity: false,
|
||||||
|
degreeLabel: false,
|
||||||
|
|
||||||
initialLoadDelay: 0, // 0 seconds delay
|
initialLoadDelay: 0, // 0 seconds delay
|
||||||
retryDelay: 2500,
|
retryDelay: 2500,
|
||||||
@ -182,9 +183,24 @@ Module.register("currentweather",{
|
|||||||
weatherIcon.className = "wi weathericon " + this.weatherType;
|
weatherIcon.className = "wi weathericon " + this.weatherType;
|
||||||
large.appendChild(weatherIcon);
|
large.appendChild(weatherIcon);
|
||||||
|
|
||||||
|
var degreeLabel = "";
|
||||||
|
if (this.config.degreeLabel) {
|
||||||
|
switch (this.config.units ) {
|
||||||
|
case "metric":
|
||||||
|
degreeLabel = "C";
|
||||||
|
break;
|
||||||
|
case "imperial":
|
||||||
|
degreeLabel = "F";
|
||||||
|
break;
|
||||||
|
case "default":
|
||||||
|
degreeLabel = "K";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var temperature = document.createElement("span");
|
var temperature = document.createElement("span");
|
||||||
temperature.className = "bright";
|
temperature.className = "bright";
|
||||||
temperature.innerHTML = " " + this.temperature + "°";
|
temperature.innerHTML = " " + this.temperature + "°" + degreeLabel;
|
||||||
large.appendChild(temperature);
|
large.appendChild(temperature);
|
||||||
|
|
||||||
wrapper.appendChild(large);
|
wrapper.appendChild(large);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user