MagicMirror² v2.14.0 is available! For more information about this release, check out this topic.

Show/Hide my own module in combination with MMM-Facial-Recognition

  • Project Sponsor Module Developer

    Hello. I’ve written a module the hides itself when no data is currently available, otherwise it shows itself. I’m using the standard this.hide() / methods.

    However things get messed up when I combine this with MMM-Facial-Recognition. I’ve read about using lockStrings to lock the module’s visibility, but as far as I understand it, I’d need the Facial Recognition module to supply a lock string upon sending the hide command as well as my own module to supply a lockString to itself upon hiding.

    Essentially I want the following behaviour:

    • My Module has no data, never show, even if called to be displayed by MMM-FR
      • My module supplies a lockString to itself with its hide command
      • module remains hidden regardless of what MMM-FR wants to do
    • My module has data, but MMM-FR wants it hidden
      • MMM-FR would need to supply a lock string with its hide command
      • module remains hidden regardless of the fact that there is data
    • My module has data AND MMM-FR wants it visible
      • both call the show() method with their respective lockStrings, thereby removing both lockStrings from my module
      • module is visible.
    1. Do I understand this correctly?
    2. Is there another way to get this behaviour without requiring a modification to MMM-Facial-Recognition? I can see myself running into this problem with some other show/hide modules, and I’d rather not have manage my own modified versions of others’ modules.

  • Project Sponsor Module Developer

    For more context on this, in fact my understanding above is correct. I modified both MMM-Facial-Recognition and my own module to use a lockString option, and the module is showing and hiding as I expect / want now.

    However it doesn’t address my second question – could I have accomplished this without modifying MMM-Facial-Recognition?

Log in to reply