MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. cskenney
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    C
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 22
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: MMM-CalendarExt2

      @Sean That did the trick. You used Calendars (with an S) for the main code section but the default section only used calendar (without the s). I didn’t notice the syntax difference. Thanks for the help.

      posted in Utilities
      C
      cskenney
    • RE: MMM-CalendarExt2

      @Sean I think I have it figured out now. If looks like putting the calendar scanInterval in the default section (look at the code I posted above) doesn’t apply it to all the calendars. Instead it looks like they are using a default value of 30 minutes. Does that make sense?

      posted in Utilities
      C
      cskenney
    • RE: MMM-CalendarExt2

      @Sean where is this log file located? I will take a look at it and see what I can find.

      posted in Utilities
      C
      cskenney
    • RE: MMM-CalendarExt2

      @Sean I understand that they are not synced. I can run a test where I set both values to 1 minute (each). I can then make a change in my calendar then come back to the MM 10 minutes later and nothing has changed.

      Last night I added an item to my calendar and waited for a couple of hours and it never appeared. Today it is added to the MM calendar. It is like it finally refreshed at midnight when it had to adjust the days.

      I am now left wondering if the scanInterval in the default section is actually only used at startup and at midnight.

      Edit: I added the scanInterval into the section for a specific calendar and it solved the problem. It looks like when the scanInterval is in the default section that it must not be applied to each calendar. The result is that each calendar is only scanned once per day (or so it seems).

      posted in Utilities
      C
      cskenney
    • RE: MMM-CalendarExt2

      @Sean I have the rotateInterval set to 0 and the updateInterval set to (5 minutes).

      I will post my code below but I will need to removed the URL to my calendars.

      		{	/*MMM-CalendardExt2*/
      			module: 'MMM-CalendarExt2',
      			config: {
      				rotateInterval: 0,	//rotate between scenes default = 60*1000; 0 disables
      				updateInterval: 5*60*1000,	//If not auto-rotated
      				firstDrawingDelay: 10*1000,	//delay to allow calendar parsing
      				locale: "en",
      				defaultSet: {
      						calendars: {
      							maxItems: 500,
      							scanInterval: 1000*60*5,
      							beforeDays: 5,
      							afterDays: 60,
      							maxIterations: 100,
      						},
      						view: {
      							timeFormat: "h:mm A",
      							transform: function(event) {
      								if (event.title.search("Panic") > -1) {
      								event.icon = "noto-softball";
      								event.className = "view_panic";
      								} else if (event.title.search("Arin") > -1) {
      								event.icon = "noto-softball";
      								} else if (event.title.search("Violin") > -1) {
      								event.icon = "emojione-monotone:violin";
      								}
      								return event;
      							},							
      						},
      						scene: {}
      				},
      				calendars: [
      					{
      						name: "Chris",
      						url: "https://calendar.google.com/calendar/ical...basic.ics",
      						className: "cal_chris",
      					},
      					{
      						name: "Kim",
      						url: "https://calendar.google.com/calendar/ical...basic.ics",
      						icon: "twemoji-medical-symbol",
      						className: "cal_kim",
      					},
      					{
      						name: "Lauren",
      						url: "https://calendar.google.com/calendar/ical...basic.ics",
      						className: "cal_lauren",
      					},
      					{
      						name: "Ryan",
      						url: "https://calendar.google.com/calendar/ical...basic.ics",
      						className: "cal_ryan",
      					},
      					{
      						name: "MHS Softball",
      						url: "https://calendar.google.com/calendar/ical/...basic.ics",
      						icon: "noto:softball",
      						className: "cal_mhs_softball",
      					},
      					{
      						name: "Softball Badgers",
      						url: "https://calendar.google.com/calendar/ical/...basic.ics",
      						icon: "noto-badger",
      						className: "cal_badgersoftball",
      					},
      					{
      						name: "BOPA",
      						url: "https://calendar.google.com/calendar/ical...basic.ics",
      						icon: "emojione-musical-score",
      						className: "cal_bopa",
      					},
      				],
      				views:[
      					{
      						name: "View_Daily",
      						mode: "daily",
      						position: "top_left",
      						calendars: ["Chris","Kim","Lauren","Ryan","MHS Softball","Softball Badgers","BOPA"],
      						hideOverflow: false,
      						filterPassedEvent: false,
      						slotCount: 2,
      						maxItems: 500,
      					},
      					{
      						name: "View_Upcoming",
      						mode: "upcoming",
      						slotTitle: "UPCOMING",
      						position: "top_center",
      						maxItems:10,
      						maxDays: 3,
      						hideOverflow: false,
      						filterPassedEvent: true,
      						calendars: ["Chris","Kim","Lauren","Ryan","MHS Softball","Softball Badgers","BOPA"],
      						className: "views_upcoming",
      					},
      					{
      						name: "View_5D_Overview",
      						title: "CALENDAR",
      						mode: "daily",
      						type: "row",
      						position: "bottom_bar",
      						maxItems: 500,
      						slotCount: 5,
      						hideOverflow: false,
      						filterPassedEvent: false,
      						calendars: ["Chris","Kim","Lauren","Ryan","MHS Softball","Softball Badgers","BOPA"],
      					},
      				],
      				scenes:[
      					{
      						name: "DEFAULT",
      						views: ["View_Daily","View_5D_Overview"],
      						className: "Scene_Default",
      					},
      				],
      			},
      		},//end of calendarext2 module
      	],
      
      };
      
      posted in Utilities
      C
      cskenney
    • RE: MMM-CalendarExt2

      Just a general question. I have my calendar pulling from 6-7 different Google calendars. I have the module configured to retrieve the calendar data every 5 minutes. I did this to allow changes made to an entry to be updated pretty quickly on my display.

      The issue is if I modify a calendar entry in my Google calendar it doesn’t get updated in the MM calendar display. If I stop MM and then restart it then everything will be correct. But leaving it running it doesn’t update with the changes. I have also seen this if I deleted a calendar entry it will remain in my MM calendar on the display.

      Here is the code I am using. I put the scan interval for the calendars in the default section.

      				locale: "en",
      				defaultSet: {
      						calendars: {
      							maxItems: 500,
      							scanInterval: 1000*60*5,
      							beforeDays: 5,
      							afterDays: 60,
      							maxIterations: 100,
      						},
      
      posted in Utilities
      C
      cskenney
    • RE: MMM-CalendarExt2

      @scuppasteve said in MMM-CalendarExt2:

      @Sean That worked perfectly . How would you go about making the slot event background not be a black gradient? I just want the whole thing to be transparent.

      You can adjust the background color in the CSS file.

      Since you already defined the eventName: “CHORES_CAL” you can use it in CSS.

      syntax:

      background-color: rgba(red, green, blue, alpha);
      

      alpha: 0~1 (0:transparent, 1:opaque)

      Try this in your CSS file.

      .CX2 .event.CHORES_CAL {
      	background-color:rgba(0,0,0,0);
      	}
      

      I believe that will make the background transparent for all the events in that eventName class.

      posted in Utilities
      C
      cskenney
    • RE: MMM-CalendarExt2

      @Sean said in MMM-CalendarExt2:

      @cskenney said in MMM-CalendarExt2:

      I also want to change the background-color and possibly the (font) color.

      Sorry for the late reply. At weekends, I rarely am in front of computer.
      You can define class in your CSS. then assign it into your transfrom code.

      transform: (event) => {  
        if (event.title.search("Recycle") > -1) {
          event.icon = "mdi:recycle"
          event.className = "CLASS_RECYCLE" // in your css/custom.css, define color and bgcolor for this class
        },
        return event
      },
      
      

      I figured that out about an hour ago and was coming back to the forums to revise my post. Thanks for confirming what I did works!

      posted in Utilities
      C
      cskenney
    • RE: MMM-CalendarExt2

      @BKeyport said in MMM-CalendarExt2:

      @cskenney Your code almost got it. - had to remove the comma on line 68 there, but it now checks out…

      I’m glad it worked for you. I edited the code above to remove the comma in case someone else tries to use it. I originally missed it when I edited your code.

      posted in Utilities
      C
      cskenney
    • RE: MMM-CalendarExt2

      @sdetweil @BKeyport I had the same issue with the arrow function. I did node -v and my system is v10.15.2. I was able to work around the issue by using the older notation like shown below.

      FYI - I just revised your code so you can copy and try it.

      65:  transform: function(event)  {  
      66:	if (event.title.search("Recycle") > -1) {
      67:	event.icon = "mdi:recycle";
      68: 	}
      69: 	return event;
      70: },
      

      EDIT - line 68 revised to fix an error

      posted in Utilities
      C
      cskenney
    • 1
    • 2
    • 3
    • 2 / 3