@Mykle1 cool. Thanks for the test. Updated script to handle
Read the statement by Michael Teeuw here.
Posts
-
RE: new update/upgrade script, ready for testing
-
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)
-
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 belowlet mainWindow; function createWindow() { app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required'); //< -------- addedsave and restart MagicMirror
-
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
-
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’ thinglet 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. ); -
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…
-
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
-
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)
-
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 -
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)