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

    Posts

    Recent Best Controversial
    • RE: MMM-GooglePhotos

      @Sean Awesome work! Loving the update!

      posted in Entertainment
      G
      gonzonia
    • RE: new update/upgrade script, ready for testing

      @sdetweil Thanks! I thought I’d tried that as well. Guess not. All good now!

      posted in General Discussion
      G
      gonzonia
    • RE: new update/upgrade script, ready for testing

      Test runs fine…This is the result when I try to apply the log will be ```
      code_text

      No LSB modules are available.
      doing test run = false
      update log will be in /home/pi/MagicMirror/installers/upgrade.log
      
      saving custom.css
      upgrading from version 2.9.0 to 2.10.0
      fetching latest revisions
      there were merge errors
      error: The following untracked working tree files would be overwritten by merge: 	installers/dumpactivemodules.js Please move or remove them before you merge. Aborting Updating 500147e..b595cdd
      you should examine and resolve them
      using the command git log --oneline --decorate
      500147e (grafted, HEAD -> master, tag: v2.9.0) Merge pull request #1776 from MichMich/develop
      restoring custom.css
      posted in General Discussion
      G
      gonzonia
    • RE: MMM-MealViewer

      Well, thanks to both of you! I can confirm it is finally working.

      Now to update github. Someday I should write some documentation too.

      posted in Development
      G
      gonzonia
    • RE: MMM-MealViewer

      @cowboysdude Thanks! I might switch to that. I’ve had to rework it a little because the URL wasn’t getting set except at the first call. I just moved setup for that into the getMenuData and I think it’s all working now. I’ll give it a day to run and see what happens tomorrow before I try messing with it again and update the file on github.

      -updated to fix grammar

      posted in Development
      G
      gonzonia
    • RE: MMM-MealViewer

      @sdetweil Thanks! I’ll make the change and see what happens when it should update mid-day tomorrow.

      posted in Development
      G
      gonzonia
    • RE: MMM-MealViewer

      Okay. I’ve identified the problem. In the code below, everything gets setup in the “start” function. Then it calls getMenuData. That function ends by setting up a timer to call itself but isn’t supplying the object necessary. This means it won’t work. If I add the _this object to pass it causes all sorts of problems.
      I’m not a js expert. I’m sure a way to re-factor this will eventually occur to me, but right now I’m just not seeing it.

      start:  function() {
          Log.log('Starting module: ' + this.name);
      
          // Set up the local values
          var today = moment();
          this.loaded = false;
          this.urls = [];
          this.results = [];
      
          // Uses now are today if before noon and tomorrow as today if after noon
          if (today.hour() >= 12) {
            var todayFormatted = today.add(1, 'day').format('MM-DD-YYYY');
          }
          else {
            var todayFormatted = today.format('MM-DD-YYYY');
          }
      
          // Currently set to only pull one day's data so endDayFormatted = todayFormatted
          //var endDay = today.add(config.showDays, 'days');
          //var endDayFormatted = endDay.format('MM-DD-YYYY');
          var endDayFormatted = todayFormatted;
      
          // Construct the url array for the schools
          for (var i in this.config.schools) {
      			this.urls.push({school: this.config.schools[i], url: 'https://api.mealviewer.com/api/v4/school/' + this.config.schools[i] + '/' + todayFormatted + '/' + endDayFormatted + '/'});
          }
      
          // Trigger the first request
          this.getMenuData(this);
        },
      
        getMenuData: function(_this) {
          // Make the initial request to the helper then set up the timer to perform the updates
          _this.sendSocketNotification('GET-MENU-DATA', _this.urls);
          setTimeout(_this.getMenuData(), _this.config.interval, _this);
        },
      
      
      
      posted in Development
      G
      gonzonia
    • RE: MMM-MealViewer

      The module works great on the initial load. The problem is that it doesn’t seem to be updating. After 12pm it’s supposed to start showing the next days meals but doesn’t. Even the next day it doesn’t update. I’ll try to dig into the core aspects of developing a module and see if I can find out why, but if anyone with more experience has any ideas where I should start looking I’d appreciate it.

      posted in Development
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean I’m starting to think the network error is irrelevant.
      I am seeing the error sometimes not related to googleapis.com. In those cases the CalendarExt2 data isn’t fully loaded, I refresh and all seems good.

      The config below seems to work.

      {
        module: "MMM-GooglePhotos",
        position: "fullscreen_below",
        config: {
          albumId: ["AD8YTEgKjrQhxAA_30358v4J7I7CXoa1_QIgcebrp1qLcFUvsIU5Hql3wPIvUDesZ72DYwbEhxSz"], // your album id(s) from result of `auth_and_test.js`
         refreshInterval: 1000*60,  
          scanInterval: 1000*60*10, // too many scans might cause API quota limit also.
          //note(2018-07-29). It is some weird. API documents said temporal image url would live for 1 hour, but it might be broken shorter. So, per 10 min scanning could prevent dead url.
          sort: "random", //'time', 'reverse', 'random'
          showWidth: "100%", // how large the photo will be shown as. (e.g;'100%' for fullscreen)
          showHeight: "100%",
          originalWidthPx: 1920, // original size of loaded image. (related with image quality)
          originalHeightPx: 1080, // Bigger size gives you better quality, but can give you network burden.
          mode: "hybrid", // "cover" or "contain" (https://www.w3schools.com/cssref/css3_pr_background-size.asp)
          //ADDED. "hybrid" : if you set as "hybrid" it will change "cover" and "contain" automatically by aspect ratio.
        }
        	},
      

      Change to

       position: "top_left",
      showWidth: "800",
      showHeight: "600",
      originalWidthPx: 800,
      originalHeightPx: 600,
      

      and it doesn’t

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean
      This module is the only one not working. though and you can see in the error I posted earlier it directly references the “photoslibrary.googleapis.com” which is why I suspected this module.

      Currently I’m not running over wifi so it’s not that it’s sleeping.

      I’ll keep trying things and see if I can find something with some consistency. Thanks for checking.

      posted in Entertainment
      G
      gonzonia
    • 1 / 1