Read the statement by Michael Teeuw here.
Dynamic Module Chaining
-
That may be a poor title - but I am trying to understand how modules can work with each other based off of various returns variables, states, etc.
For example - I would like to use a weather module (default/any) that based on the current weather (sunny, rain, storm, snow, etc.) it would then dynamically use something like MMM-Eye-Candy module and based on what the weather variable is, call the corresponding gif/sticker that relates to the current weather and then have this change as the weather changes dynamically? Would using something like MMM-Remote-Control be what I am looking for in this instance?
More to the question - is this something that is doable and just requires the code to do so or would there be any limitations within the core mm platform that would not let this work?
-
@haji6 modules can share information with other modules
by broadcasting their data (api sendNotification)
consuming modules accept the broadcast by ( api notificationReceived) and check the notification string
the default calendar and weather modules already send out their data for other modules
the weather also responds to some notifications sent from other modules
see the documentation
many other modules document the notifications they support receiving as well as send
-
@haji6 Every module that supports this SHOULD have documentation that shows how they talk to each other.
Imagine a room full of people. In that room - only one person can speak at a time.
Person A (Calendar) will yell out “I have an Event at 8:30 called Appointment” and write it on it’s part of the whiteboard (Might be nowhere). Then Person B will hear it and write it on a whiteboard where it’s told to for all to see.
This is a simplified version of how the notification system works.
My module (MMM-Multimonth) and others uses the above concept to display data. Why rewrite work when you can use what’s provided?