From 8e57458b728015e4e846a5e098dbde590ab9988d Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Mon, 7 Sep 2020 16:09:37 -0400 Subject: [PATCH] update readme, changed initial notification to NEW_PAGE --- MMM-pages.js | 2 +- readme.md | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/MMM-pages.js b/MMM-pages.js index 7a2c30a..f009207 100644 --- a/MMM-pages.js +++ b/MMM-pages.js @@ -99,7 +99,7 @@ Module.register('MMM-pages', { Log.log('[Pages]: received that all objects are created;' + 'will now hide things!'); this.sendNotification('MAX_PAGES_CHANGED', this.config.modules.length); - this.sendNotification('PAGE_CHANGED', this.curPage); + this.sendNotification('NEW_PAGE', this.curPage); this.animatePageChange(); this.resetTimerWithDelay(0); break; diff --git a/readme.md b/readme.md index 72b6ff0..0203970 100644 --- a/readme.md +++ b/readme.md @@ -65,7 +65,7 @@ For the `module` configuration option, the first element of the outer array should consist of elements that should be on the first page. The second element should consist of elements that should be on the second page, and so forth. -## Regarding notifications +## Notifications This module responds to the notification `PAGE_CHANGED`. The payload should be an `integer`. Note that this has strict error checking, so `"3"` will not work, @@ -106,6 +106,17 @@ you can send a `RESUME_ROTATION` event to resume it. If you want to return to the home page, simply send a `HOME_PAGE` notification. +### Initialization + +_This section provides documentation on what notifications the module sends on +startup. This section isn't necessary to read for most users._ + +MMM-pages doesn't activate until we receive the `DOM_OBJECTS_CREATED` +notification, as that notification ensures all modules have been loaded. On this +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 +max pages have a way to determine which page to start on. + ## FAQ - Help! My module is (above/below) another module in the same region but I want