Merge pull request #237 from roxasvalor/v2-beta

Added option for units inside of config.js
This commit is contained in:
Michael Teeuw
2016-04-24 22:56:19 +02:00
5 changed files with 6 additions and 3 deletions

View File

@@ -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`. | | `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`. | | `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`. | | `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.** | | `modules` | An array of active modules. **The array must contain objects. See the next table below for more information.** |
Module configuration: Module configuration:

View File

@@ -9,6 +9,7 @@ var config = {
language: 'en', language: 'en',
timeFormat: 24, timeFormat: 24,
units: 'metric',
modules: [ modules: [
{ {

View File

@@ -12,7 +12,8 @@ var defaults = {
language: "en", language: "en",
timeFormat: 24, timeFormat: 24,
units: "metric",
modules: [ modules: [
{ {
module: "helloworld", module: "helloworld",

View File

@@ -13,7 +13,7 @@ Module.register("currentweather",{
defaults: { defaults: {
location: "", location: "",
appid: "", appid: "",
units: "metric", units: config.units,
updateInterval: 10 * 60 * 1000, // every 10 minutes updateInterval: 10 * 60 * 1000, // every 10 minutes
animationSpeed: 1000, animationSpeed: 1000,
timeFormat: config.timeFormat, timeFormat: config.timeFormat,

View File

@@ -13,7 +13,7 @@ Module.register("weatherforecast",{
defaults: { defaults: {
location: "", location: "",
appid: "", appid: "",
units: "metric", units: config.units,
updateInterval: 10 * 60 * 1000, // every 10 minutes updateInterval: 10 * 60 * 1000, // every 10 minutes
animationSpeed: 1000, animationSpeed: 1000,
timeFormat: config.timeFormat, timeFormat: config.timeFormat,