From 0890fd521e51fa0ad3262605a5aa15c9302535bf Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:23:07 -0500 Subject: [PATCH 1/5] Added units variable --- config/config.js.sample | 1 + 1 file changed, 1 insertion(+) diff --git a/config/config.js.sample b/config/config.js.sample index 99ab2ead..0b5f45d4 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -9,6 +9,7 @@ var config = { language: 'en', timeFormat: 24, + units: 'metric', modules: [ { From a91a2c2609afd4c60ff4b5c22a54e35cc9e12f29 Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:24:44 -0500 Subject: [PATCH 2/5] Units configurable from Config.js --- modules/default/weatherforecast/weatherforecast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index ff7c4190..c1e79828 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -13,7 +13,7 @@ Module.register("weatherforecast",{ defaults: { location: "", appid: "", - units: "metric", + units: config.units, updateInterval: 10 * 60 * 1000, // every 10 minutes animationSpeed: 1000, timeFormat: config.timeFormat, From 2007f5ece49a7a50392fac239d42d7a9439f744f Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:25:35 -0500 Subject: [PATCH 3/5] Units from config.js --- modules/default/currentweather/currentweather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 3a7520ce..6c6aa100 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -13,7 +13,7 @@ Module.register("currentweather",{ defaults: { location: "", appid: "", - units: "metric", + units: config.units, updateInterval: 10 * 60 * 1000, // every 10 minutes animationSpeed: 1000, timeFormat: config.timeFormat, From 13a01d76f7be7d391faa5477a54546491da0b29a Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:33:22 -0500 Subject: [PATCH 4/5] Added default units variable Added a default units variable if users do not configure in config.js. --- js/defaults.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/defaults.js b/js/defaults.js index e3dc3d2b..28cc2613 100644 --- a/js/defaults.js +++ b/js/defaults.js @@ -12,7 +12,8 @@ var defaults = { language: "en", timeFormat: 24, - + units: "metric", + modules: [ { module: "helloworld", From 838196073750564233e1ac3e76b160f521717a77 Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:38:50 -0500 Subject: [PATCH 5/5] Added "units" configuration instructions Added instructions for configuring the units variable in config.js. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 588c61bd..4c935d31 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ The following properties can be configured: | `port` | The port on which the MagicMirror² server will run on. The default value is `8080`. | | `language` | The language of the interface. (Note: Not all elements will be localized.) Possible values are `en`, `nl`, `ru`, `fr`, etc., but the default value is `en`. | | `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. | +| `units` | The units that will be used in the default weather modules. Possible values are `metric` or `imperial`. The default is `metric`. | | `modules` | An array of active modules. **The array must contain objects. See the next table below for more information.** | Module configuration: