• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

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

Scheduled Pinned Locked Moved Development
2 Posts 1 Posters 1.3k Views 1 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    j.e.f.f Project Sponsor Module Developer
    last edited by Jun 7, 2017, 1:41 AM

    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() / this.show() 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.
    1 Reply Last reply Reply Quote 1
    • J Offline
      j.e.f.f Project Sponsor Module Developer
      last edited by Jun 7, 2017, 4:29 AM

      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?

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        1/2
        Last post
      Enjoying MagicMirror? Please consider a donation!
      MagicMirror created by Michael Teeuw.
      Forum managed by Sam, technical setup by Karsten.
      This forum is using NodeBB as its core | Contributors
      Contact | Privacy Policy