From d6bcfd4742735034118b51512283b99ade1cfe36 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Tue, 10 Dec 2024 20:45:48 +0100 Subject: [PATCH 1/6] Extend configuration section - add 'rotationTime' to example - add example for class based configuration --- README.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 78 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6afa363..e80c2a9 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Note that this module does not provide any method of manually changing the page! You should ask other developers to add a notification to their modules, or add one yourself! +## Page indicator + To display what page you're on, I highly recommend checking out my [page indicator module][page indicator]. ## Installation @@ -53,24 +55,31 @@ git pull ## Configuration -To use this module, add it to the modules array in the `config/config.js` file. +To use this module, add a configuration to the modules array in the `config/config.js` file. -*Note*: Some of the module names used in the following example are fictitious. +*Note*: Some of the module names used in the following examples are fictitious. + +### Module name based configuration + +The easiest way to configure this module is to use the module names to define on which page they should appear: + +The first element of the array is the first page, the second element is the second page, and so on. ```js { module: "MMM-pages", config: { + rotationTime: 1000 * 20, // rotate every 20 seconds modules: [ - ["newsfeed"], - ["calendar", "compliments"] + ["newsfeed"], // page 1 + ["calendar", "compliments"], // page 2 ], - fixed: [ + fixed: [ // modules that are always shown "clock", "weather", "MMM-page-indicator" ], - hiddenPages: { + hiddenPages: { // modules that are only shown on specific pages "screenSaver": [ "clock", "MMM-SomeBackgroundImageModule" @@ -84,6 +93,69 @@ To use this module, add it to the modules array in the `config/config.js` file. }, ``` +*Note:* This way you can only use one instance of each module. If you want to use multiple instances of the same module, you have to use the class based configuration. + +### Class based configuration + +Instead of using the module name, you can also use a class name for each page. This way you can have multiple instances of the same module on different pages. + +```js + { + module: "MMM-pages", + config: { + rotationTime: 1000 * 20, // rotate every 20 seconds + modules: [ + ["page1"], // class name for page 1 + ["page2"], // class name for page 2 + ["page3"], // class name for page 3 + ], + fixed: ["fixed_page"], + hiddenPages: { + "screenSaver": ["screensaver_page"], + "admin": ["admin_page"], + } + } + }, +``` + +You have to add the class name to the config of the module you want to show on a specific page. You can even add more than one class name to show a module istance on multiple pages. + +```js + { // newsfeed on page 1 + module:"newsfeed", + classes:"page1", + position: "...", + conig: { + ... + } + }, + { // first calendar instance on page 2 + module:"calendar", + classes:"page2", + position: "...", + config: { + ... + } + }, + { // second calendar instance on page 3 + module:"calendar", + classes:"page3", + position: "...", + config: { + ... + } + }, + { // this compliments istance appears on page 1 and 3 + module:"compliments", + classes:"page1 page3", + position: "...", + config: { + ... + } + }, + ... +``` + ### Configuration options | Option | Type | Default Value | Description | From bccc069a6b08fb3445d185e04641c3743aaf79a7 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sat, 14 Dec 2024 12:55:18 +0100 Subject: [PATCH 2/6] Fix typos --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e80c2a9..8984fa1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Project status -This project is **mature** and in maintence mode only. New features or fixes +This project is **mature** and in maintenance mode only. New features or fixes will not be actively made. If you'd like to see a feature or fix, please create a pull request. @@ -118,14 +118,14 @@ Instead of using the module name, you can also use a class name for each page. T }, ``` -You have to add the class name to the config of the module you want to show on a specific page. You can even add more than one class name to show a module istance on multiple pages. +You have to add the class name to the config of the module you want to show on a specific page. You can even add more than one class name to show a module instance on multiple pages. ```js { // newsfeed on page 1 module:"newsfeed", classes:"page1", position: "...", - conig: { + config: { ... } }, @@ -145,7 +145,7 @@ You have to add the class name to the config of the module you want to show on a ... } }, - { // this compliments istance appears on page 1 and 3 + { // this compliments instance appears on page 1 and 3 module:"compliments", classes:"page1 page3", position: "...", @@ -163,7 +163,7 @@ You have to add the class name to the config of the module you want to show on a | `modules` | `[[String...]...]` | `[]` | A 2D String array of what each module should be on which page. Note that 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. | | `fixed` | `[String...]` | `["MMM-page-indicator"]` | Which modules should show up all the time. | | `excludes` | *NA* | *NA* | **Deprecated**. Use `fixed` instead. | -| `hiddenPages` | `{String: [String...]...}` | `{}` | An Object defining special `hiddenPages` which are not available on the normal page rotation and only accassible via a notification. Modules defined in `fixed` are ignored and need to be also added if you wish to have them on any hidden page. | +| `hiddenPages` | `{String: [String...]...}` | `{}` | An Object defining special `hiddenPages` which are not available on the normal page rotation and only accessible via a notification. Modules defined in `fixed` are ignored and need to be also added if you wish to have them on any hidden page. | | `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. | | `rotationDelay` | `int` | `10000` | 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. | @@ -236,9 +236,9 @@ max pages have a way to determine which page to start on. ### Hidden pages The idea behind hidden pages is to be able to create special "modes" which -are totally configurable by the user and are seperated from the "normal" MM² operation. +are totally configurable by the user and are separated from the "normal" MM² operation. Some examples would be a "guest", "admin" or "screensaver" mode, where only very -specific modules are shown and you do not want to have them in your normal page roation. +specific modules are shown and you do not want to have them in your normal page rotation. These hidden pages are only accessible via notifications, so you need to send them from other modules. Examples integrations could be with touch, bots or voice commands. @@ -275,7 +275,7 @@ See also FAQ below. ## Developer commands -If you want to contribute to this poject, pleases use the following commands to maintain code quality: +If you want to contribute to this project, pleases use the following commands to maintain code quality: - `npm install` - Install development dependencies for linting. - `npm run lint` - Run linting checks. From 20758239d18632b4f32e23f0091ecbc566b2ef14 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sat, 14 Dec 2024 12:58:24 +0100 Subject: [PATCH 3/6] Fix format --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8984fa1..3f7b8dc 100644 --- a/README.md +++ b/README.md @@ -122,32 +122,32 @@ You have to add the class name to the config of the module you want to show on a ```js { // newsfeed on page 1 - module:"newsfeed", - classes:"page1", + module: "newsfeed", + classes: "page1", position: "...", config: { ... } }, { // first calendar instance on page 2 - module:"calendar", - classes:"page2", + module: "calendar", + classes: "page2", position: "...", config: { ... } }, { // second calendar instance on page 3 - module:"calendar", - classes:"page3", + module: "calendar", + classes: "page3", position: "...", config: { ... } }, { // this compliments instance appears on page 1 and 3 - module:"compliments", - classes:"page1 page3", + module: "compliments", + classes: "page1 page3", position: "...", config: { ... From 7fc77e10d06b1ac7f2fdd5302731c0cc32421200 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sat, 14 Dec 2024 13:04:06 +0100 Subject: [PATCH 4/6] Add Explanation that there are two ways to configure --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f7b8dc..289ac40 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ git pull To use this module, add a configuration to the modules array in the `config/config.js` file. +There are two ways to configure this module: Using the module names or using class names. The module name based configuration is easier to use, but has the limitations that you can only use one instance of each module. So if you want to use multiple instances of the same module, you have to use the class based configuration. + *Note*: Some of the module names used in the following examples are fictitious. ### Module name based configuration @@ -93,8 +95,6 @@ The first element of the array is the first page, the second element is the seco }, ``` -*Note:* This way you can only use one instance of each module. If you want to use multiple instances of the same module, you have to use the class based configuration. - ### Class based configuration Instead of using the module name, you can also use a class name for each page. This way you can have multiple instances of the same module on different pages. From cbe02972cda46cf6b5c5c9f59cf38a27eb71f24e Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sat, 14 Dec 2024 13:08:17 +0100 Subject: [PATCH 5/6] Align comments --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 289ac40..44368f2 100644 --- a/README.md +++ b/README.md @@ -105,9 +105,9 @@ Instead of using the module name, you can also use a class name for each page. T config: { rotationTime: 1000 * 20, // rotate every 20 seconds modules: [ - ["page1"], // class name for page 1 - ["page2"], // class name for page 2 - ["page3"], // class name for page 3 + ["page1"], // class name for page 1 + ["page2"], // class name for page 2 + ["page3"], // class name for page 3 ], fixed: ["fixed_page"], hiddenPages: { From 539db6222091e3ce14bca306d837c18dfb57ab9d Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sat, 14 Dec 2024 13:10:40 +0100 Subject: [PATCH 6/6] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44368f2..29394ef 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ git pull To use this module, add a configuration to the modules array in the `config/config.js` file. -There are two ways to configure this module: Using the module names or using class names. The module name based configuration is easier to use, but has the limitations that you can only use one instance of each module. So if you want to use multiple instances of the same module, you have to use the class based configuration. +There are two ways to configure this module: Using the module names or using class names. The module name based configuration is easier to use, but has the limitation that you can only use one instance of each module. So if you want to use multiple instances of the same module, you have to use the class based configuration. *Note*: Some of the module names used in the following examples are fictitious.