• 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.

Peek-a-boo...

Scheduled Pinned Locked Moved Troubleshooting
18 Posts 5 Posters 9.6k Views 5 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.
  • C Offline
    carteblanche @carteblanche
    last edited by carteblanche Oct 21, 2016, 7:27 PM Oct 21, 2016, 7:19 PM

    @carteblanche said in Peek-a-boo...:

    @darrene thank you for sharing your calendar.js file because that is where I found where the issue was…it was the name for the function notificationReceived: – needed to have a lower case “n”.

    Now it works perfectly!! And as you predicted I experienced a massive grin.

    update:
    I’ve been testing this out with other modules and it works like a charm. I also discovered (after trial and error) that its possible to combine the hide/show with the hide all/show all command simply by revising the if statement on the notificationReceived function with an “or” condition specifying both commands . See below is an example of the revised code:

    notificationReceived: function(notification, payload, sender) {
    if (notification === “HIDE_CALENDAR” || “HIDE_ALL”) {
    this.hide();
    } else if (notification === “SHOW_CALENDAR” || “SHOW_ALL”) {
    this.show();
    }
    },

    update: while this worked for a short period, upon further testing this code seems to cause some issues with HIDE_ALL auto suspending all modules on launch. So the or condition if statement doesn’t appear to be a viable solution, the only way to include hide/show all is the way you have the code now @darrene with the multiple else if statements.

    S 1 Reply Last reply Oct 21, 2016, 8:14 PM Reply Quote 0
    • S Offline
      strawberry 3.141 Project Sponsor Module Developer @carteblanche
      last edited by Oct 21, 2016, 8:14 PM

      @carteblanche

      if (notification === "HIDE_CALENDAR" || "HIDE_ALL")
      
      this will be always true: notification === "HIDE_CALENDAR" can be true or false, but "HIDE_ALL" will be always true
      

      that’s why it always hide the module

      it must be like that

      if (notification === "HIDE_CALENDAR" || notification === "HIDE_ALL") {
          this.hide();
      } else if (notification === "SHOW_CALENDAR" || notification === "SHOW_ALL") {
          this.show();
      }
      },
      

      Please create a github issue if you need help, so I can keep track

      C 1 Reply Last reply Oct 21, 2016, 8:17 PM Reply Quote 0
      • C Offline
        carteblanche @strawberry 3.141
        last edited by Oct 21, 2016, 8:17 PM

        @strawberry-3.141 Thank you for the tip! Now it makes perfect sense.

        It does still work with the multiple else if statements but for the sake of cleaner code I like the idea of using the or condition.

        1 Reply Last reply Reply Quote 0
        • D Offline
          darrene @carteblanche
          last edited by Oct 22, 2016, 12:30 PM

          Apologies for the typo in notification @carteblanche - I should have copied and pasted the code originally, rather than typing it off the the top of my head!

          Glad to read that you managed to sort it though. Nice work :)

          C B 2 Replies Last reply Oct 23, 2016, 5:11 AM Reply Quote 0
          • C Offline
            carteblanche @darrene
            last edited by Oct 23, 2016, 5:11 AM

            @darrene hey no worries at all on the typo. I can’t thank you enough for helping out and providing the comprehensive step-by-step guide in plain english to noobs like me. I don’t know how I would have got the voice module working without your help so thanks again!

            1 Reply Last reply Reply Quote 0
            • B Offline
              Baltibu @darrene
              last edited by Oct 23, 2016, 10:33 AM

              @darrene I think you a lot for your help.
              i get it work with all module that I have :-)
              Your descpition was very helpfull. thanks again .

              1 Reply Last reply Reply Quote 0
              • ? Offline
                A Former User
                last edited by Dec 3, 2016, 1:46 PM

                Q : have you managed to get Alexia working alongside another ‘bot/ai’?

                Any instructions for install? Many thanks!

                1 Reply Last reply Reply Quote 0
                • 1
                • 2
                • 2 / 2
                • First post
                  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