MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. sdetweil
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    S
    Offline
    • Profile
    • Following 0
    • Followers 108
    • Topics 88
    • Posts 20,667
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: new update/upgrade script, ready for testing

      @Mykle1 cool. Thanks for the test. Updated script to handle

      posted in General Discussion
      S
      sdetweil
    • RE: i think i'm close?

      @flipfloplife are you doing this over SSH? or if the PI is in console mode?

      MM requires graphics mode… (display:0)

      posted in Troubleshooting
      S
      sdetweil
    • RE: MMM-EasyBack no autostart Video

      @Stoffbeuteluwe this is due to a new restriction on the browser

      do this

      edit MagicMirror/js/electron.js
      and add the line shown below

      let mainWindow;
      
      function createWindow() {
          app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required');  //< -------- added
      

      save and restart MagicMirror

      posted in Troubleshooting
      S
      sdetweil
    • RE: SMB Working Photo Frame/Slideshow Module

      @NinjaEpisode I use MMM-ImagesPhotos from a mounted samba folder. I had to make a link from the module uploads folder to the mount. But it works fine.

      See the ln command.

      The module doesn’t know the images are not local

      Note that modules can’t see anything above the modules folder without this kind of help

      posted in Requests
      S
      sdetweil
    • RE: SmartThings

      @buzzkc so, with promises, you have a ‘then’, with a ‘resolve’ and an ‘error’ callback, and the resolve and reject methods of the promise can provide data to the resolve and error routines…

      just a reminder, the return new Promise() returns IMMEDIATELY… the function inside the promise is called async sometime (milliseconds) later

         function_name: function(parm1_in, parm2_in) {
           return new Promise( function (resolve,reject){
                   if( all_good) {
                       resolve(data_item)
                   }
                  else {
                      reject(error_data) 
                  }
           }
           )
      
      

      then the method CALLING this function

          function_name(parm1, parm2).then( 
                   resolve_func(data_item){ },
                   error_func(error_data){}
          )
      

      a working example , using the arrow function (parm) => {
      the arrow function insures that the data context of the outside caller is maintained,
      where as function(parm) { does not (u had to use the ‘self =this’ thing

      let promise = new Promise(function(resolve, reject) {
       if(!setTimeout(() => resolve("done!"), 1000)){
           reject("settimeout_failed")
       }
      });
      
      // resolve runs the first function in .then, reject runs the second function
      promise.then(     // this will block until the function inside the promise call resolve or reject
        result => alert(result), // shows "done!" after 1 second
        error => alert(error) // doesn't run .. this will never occurr as settimeout never fails. 
      );
      
      posted in General Discussion
      S
      sdetweil
    • RE: i think i'm close?

      @flipfloplife you could still be in text mode (console mode) vs the graphical desktop…

      xwindows is display:0, so you shouldn’t have to change anything…

      posted in Troubleshooting
      S
      sdetweil
    • RE: updated installer script available for testing

      the new installer referenced here is now part of the base at 2.8.0, released July 1, 2019

      posted in Troubleshooting
      S
      sdetweil
    • RE: Youtube autoplay

      @ines in the update MM uses an upgraded version of the browser that implements a new restriction, user must interact with screen before play is allowed…

      fix is to edit the MagicMirror/js/electron.js file and insert the line marked below (approx line 20)

      // Keep a global reference of the window object, if you don't, the window will
      // be closed automatically when the JavaScript object is garbage collected.
      let mainWindow;
      
      function createWindow() {
          app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required');  //< -------- added
      	var electronOptionsDefaults = {
      

      then close and restart mm

      i see there is a proposed fix in the next update (July)

      posted in Requests
      S
      sdetweil
    • RE: new update/upgrade script, ready for testing

      @bhepler i added handling for the git lock file…

      if git is NOT running, I erase the dangling lock file
      if git IS running, and this is an APPLY run, i change the run back to test mode, and advise to correct the problem

      posted in General Discussion
      S
      sdetweil
    • RE: HELP to use a cam with MM PLEASE

      and my MMM-SleepWake works with webcam for motion detection and Lucy for remembering which modules are hidden when waking by voice or movement

      and supports three different screen off approaches, tvservice (pi only) dpms (some monitors) and screen blanking(for auto power off devices, like TVs, EnergyStar)

      posted in Troubleshooting
      S
      sdetweil
    • 1 / 1