mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
currentweather, weatherforecast, changed option of decimal comma to any decimal symbol
This commit is contained in:
parent
46c0e14d67
commit
df0515cebf
30
CHANGELOG.md
30
CHANGELOG.md
@ -2,6 +2,34 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## [2.2.0] - Unreleased
|
||||||
|
|
||||||
|
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- calender week is now handled with a variable translation in order to move number language specific
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Add option to use [Nunjucks](https://mozilla.github.io/nunjucks/) templates in modules. (See `helloworld` module as an example.)
|
||||||
|
- Add Bulgarian translations for MagicMirror² and Alert module.
|
||||||
|
- Add graceful shutdown of modules by calling `stop` function of each `node_helper` on SIGINT before exiting.
|
||||||
|
- Link update subtext to Github diff of current version versus tracking branch.
|
||||||
|
- Add Catalan translation.
|
||||||
|
- Add ability to filter out newsfeed items based on prohibited words found in title (resolves #1071)
|
||||||
|
- Add options to truncate description support of a feed in newsfeed module
|
||||||
|
- Add reloadInterval option for particular feed in newsfeed module
|
||||||
|
- Add no-cache entries of HTTP headers in newsfeed module (fetcher)
|
||||||
|
- Add Czech translation.
|
||||||
|
- Add option for decimal symbols other than the decimal point for temperature values in both default weather modules: WeatherForecast and CurrentWeather.
|
||||||
|
|
||||||
|
### Updated
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed issue with calendar module showing more than `maximumEntries` allows
|
||||||
|
- WeatherForecast and CurrentWeather are now using HTTPS instead of HTTP
|
||||||
|
- Correcting translation for Indonesian language
|
||||||
|
- Fix issue where calendar icons wouldn't align correctly
|
||||||
|
|
||||||
## [2.1.3] - 2017-10-01
|
## [2.1.3] - 2017-10-01
|
||||||
|
|
||||||
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`
|
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`
|
||||||
@ -29,7 +57,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Changed 'default.js' - listen on all attached interfaces by default.
|
- Changed 'default.js' - listen on all attached interfaces by default.
|
||||||
- Add execution of `npm list` after the test are ran in Travis CI.
|
- Add execution of `npm list` after the test are ran in Travis CI.
|
||||||
- Change hooks for the vendors e2e tests.
|
- Change hooks for the vendors e2e tests.
|
||||||
- Add log when clientonly failed on starting.
|
- Add log when clientonly failed on starting.
|
||||||
- Add warning color when are using full ip whitelist.
|
- Add warning color when are using full ip whitelist.
|
||||||
- Set version of the `express-ipfilter` on 0.3.1.
|
- Set version of the `express-ipfilter` on 0.3.1.
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ The following properties can be configured:
|
|||||||
| `onlyTemp` | Show only current Temperature and weather icon. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
| `onlyTemp` | Show only current Temperature and weather icon. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
| `useBeaufort` | Pick between using the Beaufort scale for wind speed or using the default units. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
| `useBeaufort` | Pick between using the Beaufort scale for wind speed or using the default units. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
| `lang` | The language of the days. <br><br> **Possible values:** `en`, `nl`, `ru`, etc ... <br> **Default value:** uses value of _config.language_
|
| `lang` | The language of the days. <br><br> **Possible values:** `en`, `nl`, `ru`, etc ... <br> **Default value:** uses value of _config.language_
|
||||||
| `decimalComma` | Whether or not to show a decimal comma instead of a decimal point for temperature values.<br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
| `decimalSymbol` | The decimal symbol to use.<br><br> **Possible values:** `.`, `,` or any other symbol.<br> **Default value:** `.`
|
||||||
| `initialLoadDelay` | The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds) <br><br> **Possible values:** `1000` - `5000` <br> **Default value:** `0`
|
| `initialLoadDelay` | The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds) <br><br> **Possible values:** `1000` - `5000` <br> **Default value:** `0`
|
||||||
| `retryDelay` | The delay before retrying after a request failure. (Milliseconds) <br><br> **Possible values:** `1000` - `60000` <br> **Default value:** `2500`
|
| `retryDelay` | The delay before retrying after a request failure. (Milliseconds) <br><br> **Possible values:** `1000` - `60000` <br> **Default value:** `2500`
|
||||||
| `apiVersion` | The OpenWeatherMap API version to use. <br><br> **Default value:** `2.5`
|
| `apiVersion` | The OpenWeatherMap API version to use. <br><br> **Default value:** `2.5`
|
||||||
|
@ -24,7 +24,7 @@ Module.register("currentweather",{
|
|||||||
showWindDirectionAsArrow: false,
|
showWindDirectionAsArrow: false,
|
||||||
useBeaufort: true,
|
useBeaufort: true,
|
||||||
lang: config.language,
|
lang: config.language,
|
||||||
decimalComma: false,
|
decimalSymbol: ".",
|
||||||
showHumidity: false,
|
showHumidity: false,
|
||||||
degreeLabel: false,
|
degreeLabel: false,
|
||||||
showIndoorTemperature: false,
|
showIndoorTemperature: false,
|
||||||
@ -210,14 +210,13 @@ Module.register("currentweather",{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.config.decimalSymbol === "") {
|
||||||
|
this.config.decimalSymbol = ".";
|
||||||
|
}
|
||||||
|
|
||||||
var temperature = document.createElement("span");
|
var temperature = document.createElement("span");
|
||||||
temperature.className = "bright";
|
temperature.className = "bright";
|
||||||
if (this.config.decimalComma) {
|
temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel;
|
||||||
temperature.innerHTML = " " + this.temperature.replace(".",",") + "°" + degreeLabel;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
temperature.innerHTML = " " + this.temperature + "°" + degreeLabel;
|
|
||||||
}
|
|
||||||
large.appendChild(temperature);
|
large.appendChild(temperature);
|
||||||
|
|
||||||
if (this.config.showIndoorTemperature && this.indoorTemperature) {
|
if (this.config.showIndoorTemperature && this.indoorTemperature) {
|
||||||
@ -227,12 +226,7 @@ Module.register("currentweather",{
|
|||||||
|
|
||||||
var indoorTemperatureElem = document.createElement("span");
|
var indoorTemperatureElem = document.createElement("span");
|
||||||
indoorTemperatureElem.className = "bright";
|
indoorTemperatureElem.className = "bright";
|
||||||
if (this.config.decimalComma) {
|
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel;
|
||||||
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".",",") + "°" + degreeLabel;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature + "°" + degreeLabel;
|
|
||||||
}
|
|
||||||
large.appendChild(indoorTemperatureElem);
|
large.appendChild(indoorTemperatureElem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ The following properties can be configured:
|
|||||||
| `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)
|
||||||
| `lang` | The language of the days. <br><br> **Possible values:** `en`, `nl`, `ru`, etc ... <br> **Default value:** uses value of _config.language_
|
| `lang` | The language of the days. <br><br> **Possible values:** `en`, `nl`, `ru`, etc ... <br> **Default value:** uses value of _config.language_
|
||||||
| `decimalComma` | Whether or not to show a decimal comma instead of a decimal point for temperature values.<br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
| `decimalSymbol` | The decimal symbol to use.<br><br> **Possible values:** `.`, `,` or any other symbol.<br> **Default value:** `.`
|
||||||
| `fade` | Fade the future events to black. (Gradient) <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
| `fade` | Fade the future events to black. (Gradient) <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
| `fadePoint` | Where to start fade? <br><br> **Possible values:** `0` (top of the list) - `1` (bottom of list) <br> **Default value:** `0.25`
|
| `fadePoint` | Where to start fade? <br><br> **Possible values:** `0` (top of the list) - `1` (bottom of list) <br> **Default value:** `0.25`
|
||||||
| `initialLoadDelay` | The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds) <br><br> **Possible values:** `1000` - `5000` <br> **Default value:** `2500` (2.5 seconds delay. This delay is used to keep the OpenWeather API happy.)
|
| `initialLoadDelay` | The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds) <br><br> **Possible values:** `1000` - `5000` <br> **Default value:** `2500` (2.5 seconds delay. This delay is used to keep the OpenWeather API happy.)
|
||||||
|
@ -21,7 +21,7 @@ Module.register("weatherforecast",{
|
|||||||
animationSpeed: 1000,
|
animationSpeed: 1000,
|
||||||
timeFormat: config.timeFormat,
|
timeFormat: config.timeFormat,
|
||||||
lang: config.language,
|
lang: config.language,
|
||||||
decimalComma: false,
|
decimalSymbol: ".",
|
||||||
fade: true,
|
fade: true,
|
||||||
fadePoint: 0.25, // Start on 1/4th of the list.
|
fadePoint: 0.25, // Start on 1/4th of the list.
|
||||||
colored: false,
|
colored: false,
|
||||||
@ -156,23 +156,17 @@ Module.register("weatherforecast",{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.config.decimalSymbol === "" || this.config.decimalSymbol === " ") {
|
||||||
|
this.config.decimalSymbol = ".";
|
||||||
|
}
|
||||||
|
|
||||||
var maxTempCell = document.createElement("td");
|
var maxTempCell = document.createElement("td");
|
||||||
if (this.config.decimalComma) {
|
maxTempCell.innerHTML = forecast.maxTemp.replace(".", this.config.decimalSymbol) + degreeLabel;
|
||||||
maxTempCell.innerHTML = forecast.maxTemp.replace(".",",") + degreeLabel;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
maxTempCell.innerHTML = forecast.maxTemp + degreeLabel;
|
|
||||||
}
|
|
||||||
maxTempCell.className = "align-right bright max-temp";
|
maxTempCell.className = "align-right bright max-temp";
|
||||||
row.appendChild(maxTempCell);
|
row.appendChild(maxTempCell);
|
||||||
|
|
||||||
var minTempCell = document.createElement("td");
|
var minTempCell = document.createElement("td");
|
||||||
if (this.config.decimalComma) {
|
minTempCell.innerHTML = forecast.minTemp.replace(".", this.config.decimalSymbol) + degreeLabel;
|
||||||
minTempCell.innerHTML = forecast.minTemp.replace(".",",") + degreeLabel;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
minTempCell.innerHTML = forecast.minTemp + degreeLabel;
|
|
||||||
}
|
|
||||||
minTempCell.className = "align-right min-temp";
|
minTempCell.className = "align-right min-temp";
|
||||||
row.appendChild(minTempCell);
|
row.appendChild(minTempCell);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user