Git Product home page Git Product logo

Comments (12)

JanVelleman avatar JanVelleman commented on September 16, 2024

I have made a small video about the problem, first you see me restarrting the magic mirror software, then decrementing the page count with a button (mirror responds fine) the rotationdelay is set at 20 seconds. When the 20 seconds pass the mirror starts to behave weird... When restarting the mirror auto rotate works fine again until I have manually change page number...

any ideas??

https://1drv.ms/v/s!AkB62gmPn-IZgsVPY2KcrYYYYvO2jg

from mmm-pages.

JanVelleman avatar JanVelleman commented on September 16, 2024

I'm not good enough in understanding your code but if I put rotationdelay at 0 then the random behaviour does not happen.

I expect the problem is in this piece of code (setinterval?)

``
updatePages: function (manuallyCalled) {

if (this.config.modules.length !== 0) {

  // We need to use self because upstream uses an older electron and thus

  // older version of node

  const self = this;



  Log.log(`updatePages was ${manuallyCalled ? '' : 'not'} manually called`);



  // Hides the current page's elements.

  MM.getModules()

    .exceptWithClass(this.config.excludes)

    .exceptWithClass(this.config.modules[this.curPage])

    .enumerate((module) => {

      module.hide(

        self.config.animationTime / 2,

        { lockString: self.identifier }

      );

    });



  // Shows the next page's elements

  setTimeout(() => MM.getModules()

    .withClass(self.config.modules[self.curPage])

    .enumerate(module => module.show(

      self.config.animationTime / 2,

      { lockString: self.identifier },

    )), this.config.animationTime / 2);



  if (manuallyCalled && this.config.rotationTime > 0) {

    Log.log('Manually updated page! setting delay before resuming timer!');



    clearInterval(this.timer);



    setTimeout(() => {

      self.timer = setInterval(() => {

        // Incrementing page

        self.curPage = self.mod(

          self.curPage + 1,

          self.config.modules.length

        );

        self.sendNotification('PAGE_INCREMENT');

        self.updatePages(false);

      }, self.config.rotationTime, false);

    }, this.config.rotationDelay);

  }

} else { Log.error("Pages aren't properly defined!"); }

},

});

``

from mmm-pages.

edward-shen avatar edward-shen commented on September 16, 2024

Thanks for the video! I'm current out on a business trip and will be back Wednesday, so I won't be able to work on it until then.

from mmm-pages.

JanVelleman avatar JanVelleman commented on September 16, 2024

Hi, did you already have some time to look at this problem?

Sincerely

from mmm-pages.

edward-shen avatar edward-shen commented on September 16, 2024

Hello,
I'm still working on the module, but I'm starting to figure out what's going on! This module's a little more complex, and so removing rotationDelay might break other features.

Could you also please post your configs as well? Any more information helps!

from mmm-pages.

edward-shen avatar edward-shen commented on September 16, 2024

Try updating. I think I fixed the issue you were describing.

from mmm-pages.

edward-shen avatar edward-shen commented on September 16, 2024

If it doesn't work, reopen this issue and I'll happily try and work on it more!

from mmm-pages.

JanVelleman avatar JanVelleman commented on September 16, 2024

Hi Edward,

The problem seems to be solved indeed, Thanks!
However, I also use your page indicator plugin, which previously worked fine but after your update of the pages plugin it no longer updates on an automatic page increment. When I give a notifications it still changes but it doesn't when the page changes when the rotation delay rolls over?

I tried updating the indicator plugin, thinking you also updated it but it says it's already up to date.

from mmm-pages.

edward-shen avatar edward-shen commented on September 16, 2024

Whoops! I forgot to send a notification when rotating again. This should be fixed now! Sorry!

Try again, let me know if it's fixed!

from mmm-pages.

JanVelleman avatar JanVelleman commented on September 16, 2024

Works fine now :) Thx

from mmm-pages.

JanVelleman avatar JanVelleman commented on September 16, 2024

Hi, maybe unrelated but since your update I get a weird white/gray screen if I leave the mirror on for some time. I did not do anything else beside update you module. If I touch the keyboard or mouse it reurns to normal. Any idea?
20180828_092932875_ios
20180828_092946200_ios

from mmm-pages.

edward-shen avatar edward-shen commented on September 16, 2024

Wow, that's a pretty crazy issue.

Try removing my modules and see if the issue continues (e.g. commenting out the config).

I don't think this is related to MMM-pages tho, especially since it disappears after you move the mouse or use the keyboard. That sounds like an issue with the device bugging out after it tries to go to sleep.

from mmm-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.