How to lock commands (using lockstrings?)
Failix1003 opened this issue · comments
Hi everyone,
I´m completly new to rpi/MM/python but somehow managed to keep it running with some modules. I have following problem (dont know if its a Problem about MMM-voice or MMM-Facial-Recognition):
If I hide my modules with the voice module, every module will be showed again when my MMM-Facial-Recognition Module logs in/out a user. I already read about using "lockStrings" which could block the Facial Recognition to not show the modules again as long as they are hidden with the mmm-voice command, but i have no clue how and where to set them correctly.
Maybe someone faced my problem before and is able to help me out, that would be really awesome. I´m grateful for every help.
Cheers Felix
ok i think i solved it. I was testing few things and added some lines in the MMM-voice.js data.
} else if (notification === 'HIDE') {
MM.getModules().enumerate(function(module) {
module.hide(1000, function() {
Log.log(module.name + ' is hidden.');
}, {lockString: module.lockStrings.join});
});
} else if (notification === 'SHOW') {
MM.getModules().enumerate(function(module) {
module.show(1000, function() {
Log.log(module.name + ' is hidden.');
}, {lockString: module.lockStrings.join});
});
I dont know if this is the right way to do it but it works for me.