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

Help Implementing Custom Feature w/Calendar

Scheduled Pinned Locked Moved Development
5 Posts 2 Posters 193 Views 2 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.
  • R Offline
    raspberrypi9
    last edited by Mar 7, 2025, 10:26 PM

    I am using the default clock module and the MMM-GoogleCalendar module. I use 3 instances of the MMM-GoogleCalendar modules–one for my personal calendar, one for a holiday calendar, and one for a birthday calendar. I recently coded a feature which makes a birthday appear in green if it is a week away, yellow if it is a day away, and red if it is that day.

    Now, I want to made a custom feature which plays a song (in a .wav file) when there is at least one birthday on the current day. I would like the song to get played only when the user first uses the mirror on the day of the birthday.

    To do this, I created a new notification that gets put out by the default clock module at midnight every day and it is called CLOCK_NEW_DAY. When the MMM-GoogleCalendar module sees that notification, it resets a flag that tells it that the song has already been played that day. My mirror blanks the screen when it is idle and sends a SCREEN_ON notification when the user is present. So, I added code to MMM-GoogleCalendar to look for a SCREEN_ON notification and when it sees it to set a boolean called screenOn and call this.updateDom()

    I think I have all the code that I need in place, but for some reason, when I see a SCREEN_ON get generated, I can see it with MMM-ViewNotifications, but I don’t see the MMM-GoogleCalendar code receiving/responding to the notification. I’m not sure how to debug this, and I’d really appreciate any help you can offer. Thanks.

    S 1 Reply Last reply Mar 7, 2025, 10:38 PM Reply Quote 0
    • S Away
      sdetweil @raspberrypi9
      last edited by Mar 7, 2025, 10:38 PM

      @raspberrypi9 does calendar have a message in notificationReceived?

      you could use the code debugger to stop there

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      R 1 Reply Last reply Mar 7, 2025, 11:14 PM Reply Quote 0
      • R Offline
        raspberrypi9 @sdetweil
        last edited by Mar 7, 2025, 11:14 PM

        @sdetweil I am familiar with using debuggers in general programming and in embedded system, but this is my first time working on a web app. Where do I ge a debugger from and how do I attach/insert it into this process?

        S 1 Reply Last reply Mar 7, 2025, 11:24 PM Reply Quote 0
        • S Away
          sdetweil @raspberrypi9
          last edited by sdetweil Mar 8, 2025, 3:00 PM Mar 7, 2025, 11:24 PM

          @raspberrypi9 the debugger is part of the browser developers window. ctrl-shift-i, or npm start dev, which opens the developers window

          select the sources tab, find the module in the left nav, click the source file

          click on line number for stop

          ctrl-r to reload the page

          blue right pointing arrow top right is run, circle is step next inst
          arrows are step into/over

          mouse hover over variable shows value, including objects

          same ui in electron, chrome, firefox, safari, edge

          console tab shows messages, see the second link in my signature on using the elements tab

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S 1 Reply Last reply Mar 9, 2025, 4:13 PM Reply Quote 0
          • S Away
            sdetweil @sdetweil
            last edited by Mar 9, 2025, 4:13 PM

            @sdetweil did you make any progress?

            Sam

            How to add modules

            learning how to use browser developers window for css changes

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