thobach / MMM-Gestures

MMM-Gestures is a head-less 3rd party module for MagicMirror that allows to control the Magic Mirror via gestures of two types of infrared sensors. Use cases include presence awareness to trigger compliments or go into sleep mode and scrolling through news tickers or view news details.
http://blog.thomas-bachmann.com/2016/02/magic-mirror-2-0-mit-gestensteuerung.html
42 stars 12 forks source link

Support for MMM-SmartWebDisplay #9

Closed McMornan closed 2 years ago

McMornan commented 3 years ago

Hi,

works like a charm, thanks !

I added support for the module above by adding

` var smartwebdisplay = MM.getModules().withClass('MMM-SmartWebDisplay');

            if(smartwebdisplay){

                    var notification = "UNKNOWN";

                    // reverting orders since sensor is usually built in upside down
                    if(payload == 'LEFT'){
                            notification = "SWD_PREV";
                    } else if(payload == 'RIGHT'){
                            notification = "SWD_NEXT";
                    } else if(payload == 'UP'){
                            notification = "SWD_PLAY";
                    } else if(payload == 'DOWN'){
                            notification = "SWD_PAUSE";
                    } else {
                            Log.info('Not handling received gesture in this module directly:');
                            Log.info(payload);
                    }

` at the end of MMM-Gestures.js

Would be nice if you could incorporate it in further releases.

I am lazy and tend to forget what I changed before pulling :)

Cheers, Lars

thobach commented 2 years ago

Hi Lars, Thanks for your contribution. Could you please create a pull request with your change and exten the documentation accordingly? Thanks!