To sum up the list here is also an unpublished module I did a while ago
https://github.com/fewieden/MMM-ping

[card:fewieden/MMM-ping]
Requested from @amanzimdwini @Phate
To sum up the list here is also an unpublished module I did a while ago
https://github.com/fewieden/MMM-ping

[card:fewieden/MMM-ping]
Requested from @amanzimdwini @Phate
Due to no support for Scotland in the API MMM-soccer is using, this was requested from @McSorley

[card:fewieden/MMM-ScottishPremierLeague]
Another unpublished module from @paviro, which I extended the last weeks

[card:paviro/MMM-syslog]
Originally requested from @PointPubMedia
there is another user having problems with the confirmation mail https://github.com/fewieden/MMM-NFL/issues/4#issuecomment-246044906
after an issue on github i made a bugfix on a seperate branch so people can test if this will work for everyone
cd ~/MagicMirror/modules/MMM-NFL
git fetch
git checkout bugfix/time-conversion
npm install
start your mirror and see if the match start datetime is correct for your timezone
that is not a default module path should be ~/MagicMirror/modules/MMM-WunderGround
are you on the master branch?
in sensor.js you have the function getdom replace it with this
@Plati then there is no update and you are on the newest version
getDom: function(){
var wrapper = document.createElement("div");
if(this.dataFile){
var humidityRegExp = /Humidity = (.*?) %/ig;
var humidity = humidityRegExp.exec(this.dataFile)[1];
var temperatureRegExp = /Temperature = (.*?) *C/ig;
var temperature = temperatureRegExp.exec(this.dataFile)[1];
wrapper.innerHTML = "Humidity: " + humidity + "% and Temperature: " + temperature + "°C";
} else {
wrapper.innerHTML = "No data";
}
return wrapper;
}
@Plati go into the modules directory and type git pull
@andrewchumchal this is all untested and should give you just a direction on how it could be solved. make sure you update the dom when receiving data
socketNotificationReceived: function(notification, payload){
if(notification === "DATA"){
this.droplets = payload;
this.updateDom();
}
},
getDom: function() {
var wrapper = document.createElement("div");
if(this.droplets){
var table = document.createElement("table");
for(var i = 0; i < this.droplets.droplets.length; i++){
var row = document.createElement("tr");
var name = document.createElement("td");
name.innerHTML = this.droplets.droplets[i].name;
row.appendChild(name);
var status = document.createElement("td");
status.innerHTML = this.droplets.droplets[i].status;
row.appendChild(status);
var ips = '';
for(var n = 0; n < this.droplets.droplets[i].networks['v4'].length; n++;){
ips += this.droplets.droplets[i].networks['v4'][n].ip_address + ' | ';
}
for(var n = 0; n < this.droplets.droplets[i].networks['v6'].length; n++;){
ips += this.droplets.droplets[i].networks['v6'][n].ip_address + ' | ';
}
ips = ips.replace(/ | $/, '');
var ip = document.createElement("td");
ip.innerHTML = ips;
row.appendChild(ip);
table.appendChild(row);
}
wrapper.appendChild(table);
} else {
wrapper.innerHTML = "No data to show!";
}
return wrapper;
},
@bjoern sounds like a great module idea, if you want I can assist you with that
url: "", //Insert your url here
result: false,
defaults: {
updateInterval: 30 * 60 * 1000 //Every 30 mins
},
start: function(){
this.getData();
setInterval(()=>{
this.getData();
}, this.config.updateInterval);
},
getDom: function() {
var wrapper = document.createElement("div");
if(this.result){
var table = document.createElement("table");
for (var i = 0; i < this.result.length; i++) {
var row = document.createElement("tr");
var name = document.createElement("td");
name.innerHTML = this.result[i].name;
row.appendChild(name);
table.appendChild(row);
}
wrapper.appendChild(table);
} else {
wrapper.innerHTML = "No data to show!";
}
return wrapper;
},
getData: function(){
$.getJSON(this.url, (data) => {
this.result = data;
this.updateDom();
});
}
getDom: function () {
var wrapper = document.createElement("div");
var table = document.createElement("table");
$.getJSON(this.url,
function (data) {
for (var i = 0; i < data.length; i++) {
var row = document.createElement("tr");
var name = document.createElement("td");
name.innerHTML = data[i].name;
row.appendChild(name);
table.appendChild(row);
}
wrapper.appendChild(table);
return wrapper;
});
but I’m pretty sure that this will not work, because the return is in an asynchronous callback, i would do a different structure call your url in an interval somewhere else and save your data into an module variable and call the updateDom function after a result, then in getDom you iterate over the data.
@andrewchumchal this is just how you can access status name and the ip in getDom for example but you still need to render this
for(var i = 0; i < this.droplets.droplets.length; i++;){
var name = this.droplets.droplets[i].name;
var status = this.droplets.droplets[i].status;
var ip = '';
for(var n = 0; n < this.droplets.droplets[i].networks['v4'].length; n++;){
ip += this.droplets.droplets[i].networks['v4'].ip_address + ' | ';
}
for(var n = 0; n < this.droplets.droplets[i].networks['v6'].length; n++;){
ip += this.droplets.droplets[i].networks['v6'].ip_address + ' | ';
}
ip = ip.replace(/ | $/, '');
}
socketNotificationReceived: function(notification, payload){
if(notification === "DATA"){
this.droplets = payload;
}
},