Read the statement by Michael Teeuw here.
MMM-Scenes2
-
MMM-Scenes2
“Life is a theatre set in which there are but few practicable entrances.”
― Victor Hugo, Les Misérables
MagicMirror module to change screen scenes by time and order with ANIMATION EFFECT.
Demo
Click To Play
Click it to see the DEMO.
Its configuration file is in/examples/config.js.exampleSuccessor of
MMM-ScenesSince MM 2.25, a new feature,
animateCSSis introduced into the MagicMirror.By this update, my previous
MMM-Sceneswill be obsoleted. So I remade a new module for MM 2.25- The update can provide more effects now. ( without my effort. :D )
- I guess custom animation is rarely used, and this update would cover most use-cases. So I decided to drop it.
- I redesigned the structure more simply and intuitively. (
roleis introduced.)
Concept
The scenario of the MM screen comprises a series of scenes. Each module has its role in its appearance scenes to enter and exit by design.
When a scene begins, all modules whose roles end will be expelled, and all modules with the parts in that scene will be admitted.
As described in the scenario, your MM screen will play a drama with modules.
Features
- control show/hide modules by assigning role names to the module’s class
- various animations for modules exit/enter
- control scenes by notification and WebURL endpoints.
- Loop control
- custom indicators
-
@MMRIZE thanks for the great module! I’ve added it to my MagicMirror and it works great but I’ve noticed that it stops rotating scenarios after about an hour or so. I haven’t done much troubleshooting yet but have you encountered this behavior before? I’m running it on an rpi4 8GB.
-
@hrmax23
I need a log when it stops. (It would not be backend-log, it should be frontend-log.) If possible, Use MMM-LogExt to record long term front-end log. -
@MMRIZE
I added MMM-LogExt and attached the log around the time the scenario switching stops.
-
@hrmax23
Hmmmm… Could you try withoutMMM-MyScoreboardmodule? -
@hrmax23
MMM-MyScoreboardis trying to control Show/Hide by itself. I don’t know why, anyway it does. I guess it doesn’t want to show empty content. However, its code is depending on the old MM’s code./* We're using the lockString parameter to play nicely with other modules that attempt to show or hide this module, e.g.: MMM-Facial-Recognition. When both use a lockString, the module will only be visible when both agree that it should be visible. */ if (!anyGames) { this.hide(1000, {lockString: this.identifier}); } else { this.show(1000, {lockString: this.identifier}); }.hide(duration, options)and.show(duration, options)were changed in a meantime as.hide(duration, callback, options)and.show(duration, callback, options). So that makes those error messages.[ERROR] [module.js:395:8] Parameter mismatch in module.show ...Maybe that prevents other controller module(like MMM-Scenes2)'s working. I guess so.
-
@MMRIZE
I actually removed MMM-MyScoreboard from the scenario prior to your post and you are right that it’s the module causing the issue. That module seems dormant so I may try to see if I can fork it and try to fix it.Thanks for your help in looking into the issue!
-
I may have spoken too soon. It has been working for about 12 hours but just froze on MMM-MyStandings so maybe that module has a similar issue.
-
@hrmax23 many of the modules have a design flaw copied from one of the original modules.
the web side provides the timing control to request data, which is reset when the helper responds.
but if the helper encounters an error( network glitch, timeout… ), it does not respond. and so the main side is waiting and the helper thinks it is done… deadlock not recoverable until restart
-
@sdetweil Can I ask a stupid question? When I initially started coding my first module I was advised to handle the suspend and resume in the module and picked the samples up from I think your sample module or maybe it was another module. Apologies if it was not yours.
Are we saying it is bad practice to use the two together? I.e. handling the suspend and resume etc. in module and should rather leave it out completely?
-
@mumblebaj well, it depends…
if you want you module to continue to get data in the background when suspended, then no need to hook suspend and resume…
but those calls will count against your data cap at the provider…
my code doesn’t ‘handle’ the suspend/resume, just stays informed…also, if you had a long refresh interval (once every hour for example) , the data might be stale if you don’t refresh on wake up… like overnight.
my system suspends all (hides) to blackout the screen as my monitors don’t support off/on…
in this case the calls made while suspended would be wasted work… -
@sdetweil Thanks Sam for the explanation. So it depends on the module design and data provider etc.
-
@mumblebaj
Usually, implementing thesuspendandresumemethods of the MM module is useful when your module depends on expensive resources. When your module is inactivated, it would be better to stop consuming resource.
But that mechanism is somehow annoying for me, so I ignore those methods. :D -
@mumblebaj said in MMM-Scenes2:
So it depends on the module design and data provider etc
correct… other users might not know or understand the data provider issues, so in my opinion, if you are posting for other users consumption, you should consider this as a design requirement… (to be debugged later if you don’t do it from the beginning)
-
@MMRIZE said in MMM-Scenes2:
But that mechanism is somehow annoying for me, so I ignore those methods
what could be annoying… they call, you set a flag.
you save any timer handle when u start it anyhow…so on sleep you stop it, and on resume you restart the timer… what could be so hard
if you get data back while suspended, you don’t call updateDom(), and don’t restart the data requesttiny amount of code…
-
-
what could be annoying… they call, you set a flag.
It may be a relative point of view.
Let’s assume my module is using a paid API that has a daily quota. To save the consumption API quota on unused time, it would be better to suspend/resume the process of the node_helper(usually node_helper takes a charge to consume API)
However, some API needs an expensive re-establishment fee for their usage. For example, some Google APIs might have short valid lifetimes of retrieved tokens and data. So, it needs to begin with handshaking again at some point. It may require the additional cost of the connection/auth/indexing process. If some 3rd party module tries to resume/suspend my module in a habitual rapid cycle, It might be another abused waste of consumption and, even worse, unpredictable.
I said this would be annoying for me.Of course, I might also be able to manage the lifecycle of resource consumption, but I think it is not worth it, at least based on my experience with MM modules. (Yup, I’m the one who made most many modules in this scene.)
I prefer background-alive with silence than suspend/resume modules frequently. It is more stable. (at least for me.) -
@MMRIZE yes, there can be consequences
-
@sdetweil Hence I always warn users of API limitations. if they exceed then it becomes their issue.
-
@mumblebaj well… not really. the modules mostly don’t recover, the user doesn’t know, and then we waste time trying to debug it. lots of modules don’t report failures in the node_helper either.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login