I’m in need of help understanding how this “sendNotification” items works from one module to the other.
Does a module sends it in general or is it targeting a specific other module?
And if it is sending the notification in general to all modules how must I configure the module that actualy needs to do something with those notifications?
I would like to use MMM-Swipe (That uses 2 HC-SR04 units) to controle MMM-Pages and MMM-Page-Indicator.
I have the Pages modules already installed. And I’m creating a test setup with the 2 ultra sonic sensors this weekend to test the workings.
But I have no clue what file I need to alter so that when I “swipe” across the 2 sensors the pages actualy change.
Looking at the readme-file that came with the Swipe module it says:
This module will use the sendNotification(notification, payload) to send:
notification = 'MOVEMENT'
payload = 'Swipe Left', 'Swipe Right', or 'Press'
Please use as appropriate in your module using notificationReceived(notification, payload, sender)
While in the Pages.js file I read that that module listens to the notifications:
Handles incoming notifications. Responds to the following:
‘PAGE_CHANGED’ - Set the page to the specified payload page.
‘PAGE_INCREMENT’ - Move to the next page.
‘PAGE_DECREMENT’ - Move to the previous page.
‘DOM_OBJECTS_CREATED’ - Starts the module.
‘QUERY_PAGE_NUMBER’ - Requests the current page number
I was hoping to find something that looks like:
if payload = then do this…
Is there someone willing to have a look and tell me what to configure?
I could look all day at the code and still don’t get it.