Read the statement by Michael Teeuw here.
Help Implementing Custom Feature w/Calendar
-
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.
-
@raspberrypi9 does calendar have a message in notificationReceived?
you could use the code debugger to stop there
-
@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?
-
@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/overmouse 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
-
@sdetweil did you make any progress?