barnabycolby / MMM-Carousel

Displays a single magic mirror module at a time, rotating through the list of configured modules in a carousel-like fashion.
98 stars 33 forks source link

Adding Config for Carousel per `position` #6

Closed izanbard closed 7 years ago

izanbard commented 7 years ago

In using magic mirror, I have plenty of space to spread my modules out, but I still have overall space issues. What I need to be able to do is carousel each position independently, rather than globally doing them all.

To that end I have extended MMM-Carousel to include configuration for each position. The whole change is predicated by a new config flag global which defaults to true, so default behaviour is unchanged.

Please see the changes in the README.md for details of how the config works.

izanbard commented 7 years ago

okay so I have tidied all the lint problems, but I am not sure how to fix your tests. I am not a javascript engineer really and don't have the tools to run nodeunit locally. I am scratching in the dark a bit and wasting time. The code does work, but the tests do not.

izanbard commented 7 years ago

Okay so I have worked out how to run the tests locally. I am out all this week, but will have a look at what I can do when I get back.

izanbard commented 7 years ago

slides is very subtly different to what I have done here.

With slide you need to actively include the modules you want to see. Thus any new module is not automatically included. Further the same modules are always displayed together which is probably a good effect if you want it, but consider where I have three modules in the top_left position and only 2 in the top_right. Using slides there would be a slide where the top_right would either be empty or one of the top_right modules would have double the time.

Using positional based rotation, each position is independent of the others so in my example the topleft would rotate through three mods while top right would rotate through two mods. This will result in different mods being paired at a time in top* positions which may not be desired, but in my case is. Further using positional based rotation, there is no need for me to mention in every slide the four modules I have in the bottom bar that I always want to be visible.

So yes slides would be a good feature, but not what I was looking for. I will have a look at the slides feature when I get back and see if it can be parallel implemented (best of both worlds), but in the mean time any advice on how to get test.js to work with the reworked moduleTransition() would be great (note: that I have bound the var modules to it now rather than this)