@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.
@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.
@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
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 ;)
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.
@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?
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.
I plan to share it via GitHub this week so if you care to wait a day or so, we can combine efforts!
@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.
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:
And here’s the compact view:
MMM-Formula1 allows you to display the driver and constructor standings from the current Formula 1 season right on your MagicMirror.
[card:ianperrin/MMM-Formula1]
showConstructor
option to hide constructor in driver standings - thanks @MichMichgrayscale
option - thanks @HenningSchulzshowFooter
option - thanks @HenningSchulzcalendar
option now defaults to false