updating readme

This commit is contained in:
skuethe 2020-11-05 22:49:40 +01:00 committed by Sebastian Küthe
parent ac765c968f
commit 79d4327a5a
2 changed files with 23 additions and 2 deletions

View file

@ -307,7 +307,6 @@ Module.register('MMM-pages', {
// Only proceed if the named hidden page actually exists // Only proceed if the named hidden page actually exists
if (name in this.config.hiddenPages) { if (name in this.config.hiddenPages) {
this.animatePageChange(name); this.animatePageChange(name);
//this.sendNotification('NEW_PAGE', this.curPage);
} else { Log.error(`[Pages]: Given name for hidden page ("${name}") does not exist!`); } } else { Log.error(`[Pages]: Given name for hidden page ("${name}") does not exist!`); }
} }
}, },

View file

@ -18,10 +18,13 @@ In your terminal, go to your MagicMirror's Module folder:
```bash ```bash
cd ~/MagicMirror/modules cd ~/MagicMirror/modules
``` ```
Clone this repository: Clone this repository:
```bash ```bash
git clone https://github.com/edward-shen/MMM-pages.git git clone https://github.com/edward-shen/MMM-pages.git
``` ```
Configure the module in your config.js file. Configure the module in your config.js file.
*\<self-promotion>* *\<self-promotion>*
@ -33,7 +36,9 @@ To display what page you're on, I'd highly recommend checking out my
## Using the module ## Using the module
To use this module, add it to the modules array in the `config/config.js` file: To use this module, add it to the modules array in the `config/config.js` file.
Note: module names used in the following example can be fictitious.
```js ```js
modules: [ modules: [
{ {
@ -43,6 +48,10 @@ modules: [
[[ "weatherforecast", "newsfeed"], [[ "weatherforecast", "newsfeed"],
[ "calendar", "compliments" ]], [ "calendar", "compliments" ]],
fixed: ["clock", "currentweather", "MMM-page-indicator"], fixed: ["clock", "currentweather", "MMM-page-indicator"],
hiddenPages: {
"screenSaver": [ "clock", "MMM-SomeBackgroundImageModule" ],
"admin": [ "MMM-ShowMeSystemStatsModule", "MMM-AnOnScreenMenuModule" ],
},
} }
} }
] ]
@ -98,6 +107,7 @@ This module keeps track of pages by their index rather than their page number,
so the leftmost page has an index of 0, the page to the right of that has an so the leftmost page has an index of 0, the page to the right of that has an
index of 1, and the page to the right of that has an index of 2. Thus, to change index of 1, and the page to the right of that has an index of 2. Thus, to change
to the third page, your module should send out: to the third page, your module should send out:
```js ```js
this.sendNotification("PAGE_CHANGED", 2); this.sendNotification("PAGE_CHANGED", 2);
``` ```
@ -120,7 +130,19 @@ notification, we send two notifications out, `MAX_PAGES_CHANGED` and `NEW_PAGE`,
so other modules that would like to keep synchronized of the starting page and so other modules that would like to keep synchronized of the starting page and
max pages have a way to determine which page to start on. 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.
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.
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.
See also FAQ below.
## FAQ ## FAQ
- How do I interact with different pages? - How do I interact with different pages?
MMM-pages intentionally does not provide methods to interact with the pages. MMM-pages intentionally does not provide methods to interact with the pages.