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

    Posts

    Recent Best Controversial
    • RE: MMM-ModuleScheduler Loading Wrong Date

      @snille - you’re spot on. MMM-ModuleScheduler uses the cron module. The ranges for cron values can be found in the npm module documentation.

      I’ve added an issue in the GitHub repository to update the documentation for the module.

      posted in Troubleshooting
      I
      ianperrin
    • RE: How to insert a GitHub card in a post?

      @Cato here’s the format:

      [ card:username/repository-name ]
      

      Without the spaces!

      posted in Forum
      I
      ianperrin
    • RE: Can't load script correctly

      @strawberry-3-141 I encountered the same issue when trying to create a map the showing the route of the last Strava activity.

      To continue using google maps, my solution was a little more complex, but if I recall correctly allowed me to specify a callback when loading the Google Maps API. Though I hadn’t thought about loading it in the start function :) :

          start: function() {
              this.mapId = this.identifier + "_gmap";
              Log.log(this.name + ' is started!');
          },
      
          // Override dom generator.
          getDom: function() {
              var self = this;
              var wrapper = document.createElement("div");
              var map = document.createElement("div");
              map.id = this.mapId;
              map.classList.add("map-canvas");
              map.style.height = "200px";
              map.style.width = "200px";
              wrapper.appendChild(map);
      
              this.getScript('https://www.google.com/jsapi', function() { 
                  google.load('maps', '3', { other_params: 'key=' + self.config.google_maps_key, callback: function() {
                      self.initMap();
                  }});
              });
              
              return wrapper;
          },
          
          initMap: function() {
              if (typeof google === 'object' && typeof google.maps === 'object') {
                  // Create map
                  //var mapContainer = document.getElementById(this.mapId);
                  var map = new google.maps.Map(document.getElementById(this.mapId), {
                    backgroundColor: 'none',
                  });
                  map.setZoom(8);
                  map.setCenter(new google.maps.LatLng(37.4419, -122.1419));
              }
          },
          
          getScript: function(source, callback) {
            var script = document.createElement('script');
            var prior = document.getElementsByTagName('script')[0];
            script.async = 1;
            prior.parentNode.insertBefore(script, prior);
        
            script.onload = script.onreadystatechange = function( _, isAbort ) {
                if(isAbort || !script.readyState || /loaded|complete/.test(script.readyState) ) {
                    script.onload = script.onreadystatechange = null;
                    script = undefined;
        
                    if(!isAbort) { if(callback) callback(); }
                }
            };
        
            script.src = source;
          }
      

      In the end I have currently settled on using Leaflet.js - which, depending on which tile layer you use, has the added benefit of not requiring API keys (one less thing for users to configure), can be loaded locally (and via the getScripts function) and there are existing black and white/grayscale map tiles available which compliment the Mirror.

          // Subclass getScripts method.
          getScripts: function() {
              return [
                  this.file('js/leaflet.js'),
              ];
          },
      

      Hope this helps a little

      posted in Development
      I
      ianperrin
    • RE: MMM-NetworkScanner

      Hi all

      The updates last week seem to have introduced a few issues - sorry folks!

      I’ve quashed one bug with MAC Address scans which you can git pull from the repo to see if that helps, but there still appear to be a few others which need resolving.

      I am looking at it but please bear with me ;)

      posted in Utilities
      I
      ianperrin
    • RE: MMM-ModuleScheduler - Module Schedules and Notifications

      @Henrik

      It’s not possible for MMM-ModuleScheduler to affect the behaviour of the modules it hides/shows.

      However, it is possible for a modules to ‘react’ to being shown/hidden.

      To reduce the API calls the developer of the modules you use could implement/subclass the suspend and resume methods.

      posted in System
      I
      ianperrin
    • RE: MMM-Soccer - Standings, Schedules and Top Scorers

      @strawberry-3.141 care to share your plans - perhaps I can contribute?

      I also notice you’ve hardcoded the leagues into the subclassed start method. Is there a reason for this, because it means that I can’t override them via config to use other leagues?

      posted in Sport
      I
      ianperrin
    • RE: Strava widget

      @d3r

      I created the basis for a Strava module last weekend, but got distracted looking at @strawberry-3-141 's MMM-soccer module. ;)

      Here’s a screenshot which grabs the recent stats and totals from the Strava API and displays them in a table.

      0_1470247639644_MMM-Strava.png

      I plan to share it via GitHub this week so if you care to wait a day or so, we can combine efforts!

      posted in Requests
      I
      ianperrin
    • RE: [Remote-Control] Shutdown, Configure and Update your MagicMirror

      @Jopyth - the font awesome package was updated in v2.7 so the direct reference to FA in remote.html will need to be updated.

      It looks like this line
      link rel="stylesheet" type="text/css" href="vendor/node_modules/font-awesome/css/font-awesome.min.css"
      Should be changed to
      link rel="stylesheet" type="text/css" href="vendor/css/font-awesome.css"

      But I’m away from my mirror right now so cannot test it.

      posted in System
      I
      ianperrin
    • RE: MMM-Soccer - Standings, Schedules and Top Scorers

      @strawberry-3-141

      I’ve just sent you a pull request which attempts to find a solution for smaller screens (compact mode). Not perfect, but an initial prototype!

      Here’s the original full table:
      full table

      And here’s the compact view:
      compact table

      posted in Sport
      I
      ianperrin
    • MMM-Formula1 - Formula 1 Standings

      Description:

      MMM-Formula1 allows you to display the driver and constructor standings from the current Formula 1 season right on your MagicMirror.

      Screenshots:

      Example Screenshot

      Download:

      [card:ianperrin/MMM-Formula1]


      Change Log

      Version 1.4.0

      • Added showConstructor option to hide constructor in driver standings - thanks @MichMich
      • Added translations for Season and Round labels in the table footer - thanks @The-Exterminator
      • Added Danish translation - thanks @The-Exterminator
      • Changed API calls to use the f1-api package <- this is a breaking change, please see docs for updating the module

      Version 1.3.0

      • Added Swedish translation - thanks @el97
      • Added support for Monegasque nationality
      • Re-factored code to use templates for module layouts

      Version 1.2.2

      • Added grayscale option - thanks @HenningSchulz
      • Added showFooter option - thanks @HenningSchulz
      • Added Indonesian translation - thanks @slametps
      • Tweaked table layout to improve display when module is positioned right

      Version 1.2.1

      • Calendar now respects the season option
      • calendar option now defaults to false
      • Multiple constructors are displayed in the drivers standings if the driver drivers for more than one team in the season

      Version 1.2

      • Added ability to publish a calendar containing the current Race Schedule which can be displayed in the default cslendar module

      Version 1.1

      • Added Constructors standings - thanks @strawberry-3-141
      • Added option to choose season to display - thanks @strawberry-3-141
      • Added support for translations
      • Added flags to indicate drivers nationality
      • Add option to limit number of rows displayed in standings table

      Version 1.0

      • Initial Version

      Notes

      • This is work in progress so please feel free to contribute!
      • If you have ideas for new features, or think you’ve found a bug, please add a new issue here: https://github.com/ianperrin/MMM-Formula1/issues
      posted in Sport
      I
      ianperrin
    • 1 / 1