MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.20.0 is available! For more information about this release, check out this topic.

    Peek-a-boo...

    Troubleshooting
    5
    18
    7628
    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
      carteblanche @darrene last edited by carteblanche

      @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();
      }
      },

      C D 2 Replies Last reply Reply Quote 0
      • C
        carteblanche @carteblanche last edited by carteblanche

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

        strawberry 3.141 1 Reply Last reply Reply Quote 0
        • strawberry 3.141
          strawberry 3.141 Project Sponsor Module Developer @carteblanche last edited by

          @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 Reply Quote 0
          • C
            carteblanche @strawberry 3.141 last edited by

            @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
              darrene @carteblanche last edited by

              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 Reply Quote 0
              • C
                carteblanche @darrene last edited by

                @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
                  Baltibu @darrene last edited by

                  @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
                  • ?
                    A Former User last edited by

                    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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy