diff --git a/MMM-pages.js b/MMM-pages.js index a35ac97..f30d7e7 100644 --- a/MMM-pages.js +++ b/MMM-pages.js @@ -10,7 +10,8 @@ Module.register('MMM-pages', { */ defaults: { modules: [], - excludes: ['MMM-page-indicator'], + excludes: [], // Keep for compatibility + fixed: ['MMM-page-indicator'], animationTime: 1000, rotationTime: 0, rotationDelay: 10000 @@ -40,6 +41,12 @@ Module.register('MMM-pages', { */ start: function() { this.curPage = 0; + + // Compatibility + if (this.config.excludes.length) { + Log.warn(`[Pages]: The config option "excludes" is deprecated. Please use "fixed" instead.`); + this.config.fixed = this.config.excludes; + } // Disable rotation if an invalid input is given this.config.rotationTime = Math.max(this.config.rotationTime, 0); @@ -140,7 +147,7 @@ Module.register('MMM-pages', { // Hides all modules not on the current page. This hides any module not // meant to be shown. MM.getModules() - .exceptWithClass(this.config.excludes) + .exceptWithClass(this.config.fixed) .exceptWithClass(this.config.modules[this.curPage]) .enumerate(module => module.hide( self.config.animationTime / 2, diff --git a/readme.md b/readme.md index 23c501b..0c9aa74 100644 --- a/readme.md +++ b/readme.md @@ -42,7 +42,7 @@ modules: [ modules: [[ "weatherforecast", "newsfeed"], [ "calendar", "compliments" ]], - excludes: ["clock", "currentweather", "MMM-page-indicator"], + fixed: ["clock", "currentweather", "MMM-page-indicator"], } } ] @@ -50,12 +50,13 @@ modules: [ ## Configuration options -| Option | Type | Default Value | Description | -| --------------- | ------------------ | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modules` | `[[String...]...]` | `[]` | A 2D String array of what each module should be on which page. Notethat all entries must take their class name (e.g. this module's class name is `MMM-pages`, while the default modules may just have `newsfeed`, without the `MMM-` prefix. | -| `excludes` | `[String...]` | `["MMM-page-indicator"]` | Which modules should show up all the time. | -| `animationTime` | `int` | `1000` | Fading animation time. Set to `0` for instant change. Value is in milliseconds (1 second = 1000 milliseconds). | -| `rotationTime` | `int` | `0` | Time, in milliseconds, between automatic page changes. | +| Option | Type | Default Value | Description | +| --------------- | ------------------ | ------------------------ | --------- | +| `modules` | `[[String...]...]` | `[]` | A 2D String array of what each module should be on which page. Notethat all entries must take their class name (e.g. this module's class name is `MMM-pages`, while the default modules may just have `newsfeed`, without the `MMM-` prefix. | +| `excludes` | *None* | *None* | **Deprecated** Use `fixed` instead. | +| `fixed` | `[String...]` | `["MMM-page-indicator"]` | Which modules should show up all the time. | +| `animationTime` | `int` | `1000` | Fading animation time. Set to `0` for instant change. Value is in milliseconds (1 second = 1000 milliseconds). | +| `rotationTime` | `int` | `0` | Time, in milliseconds, between automatic page changes. | | `delayTime` | `int` | `0` | Time, in milliseconds, of how long should a manual page change linger before returning to automatic page changing. In other words, how long should the timer wait for after you manually change a page. This does include the animation time, so you may wish to increase it by a few seconds or so to account for the animation time. | For the `module` configuration option, the first element of the outer array