@Wiltify said in Possible Error in My Code?:
module: “clock”,
position: “top_left”
Yes after this line in your config you didn’t add the coma
position: 'top_left',
;)
@Wiltify said in Possible Error in My Code?:
module: “clock”,
position: “top_left”
Yes after this line in your config you didn’t add the coma
position: 'top_left',
;)
Good things happen when your config.js is working ;)
@malicious_banjo said in Subreddit feed?:
Reddit’s API
https://www.npmjs.com/package/rereddit
Try that ;)
Sam is a REALLY smart guy so he gives you the smart guy answer…
I’m not as smart so I give you my dumb guy answer LOL
It will work either way … so now you def have an answer that works :)
Added a new condensed format for NOAA3 … it uses MMM-NOAA5.css file. To set that please see readme~
Please follow Readme on Github!
To update just do a ‘git pull’ in the MagicMirror/modules/MMM-NOAA3 directory
[card:cowboysdude/MMM-NOAA3]
@Spankythemusical If there’s an api for it, yes.
Try this:
https://github.com/cowboysdude/MMM-Comic
You can get Calvin and Hobbes or Frazz comic strip…
@StuGrunt said in Head first developing MM module for extreme beginners:
It is because there is an error (at least I think so - I am new too) and no instructions on where to put the function.
change the Module.register(“MMM-Timetable”) to Module.register(“MMM-Test”)
The article does not tell you where to put the getDom function when it is first introduced. Replace the getDom: function() {}. with the code shown. In other words, don’t just add it to the file. This article would have benefited from a final section that gave the entire code.
I think the original author at least expected us to be very familiar with Node.js (fair enough), but alas, I am not so it took a bit of work to figure it out. :-)
Here it is, for the first part:
Module.register(“MMM-Test”, {
defaults: {},
start: function () {},getDom: function() {
var element = document.createElement(“div”)
element.className = “myContent”
element.innerHTML = “Hello, World!”
return element
},
notificationReceived: function() {},
socketNotificationReceived: function() {},
})
_
Both of those functions go outside the getDom function pretty much anywhere you want to put them.
The socketNotificationReceived function [example below, can be used in either node_helper OR your main.js file. The example below is in my node_helper] :
socketNotificationReceived: function(notification, payload) {
if (notification === 'CONFIG') {
this.config = payload;
}
if (notification === 'GET_CURRENT') {
this.getCurrent(payload);
}
if (notification === 'GET_FORECAST') {
if (this.forecast.timestamp === this.getDate() && this.forecast.data !== null) {
this.sendSocketNotification('FORECAST_RESULT', this.forecast.data);
console.log("Using data we already have");
} else {
this.getForecast();
console.log("Getting new data");
}
}
}
Here is the corresponding one in the main.js
socketNotificationReceived: function(notification, payload) {
if (notification === "CURRENT_RESULT") {
this.processCurrent(payload);
}
if (notification === "FORECAST_RESULT") {
this.processForecasts(payload);
}
this.updateDom(this.config.initialLoadDelay);
},
You can use notificationReceived to receive info from other modules like this:
Here are examples of that:
notificationReceived: function (notification, payload){
if (notification === 'CURRENT_RESULT') {
this.processCurrent(payload);
}
},
this.sendNotification('CURRENT_RESULT', payload);
This is how I send and receive my ‘payload’ from one module to another.
The first example is getting my ‘CURRENT_RESULT’ [getting info for a Forecast module from the Current weather module] from the bottom example that is
sending out ‘CURRENT_RESULT’…
The bottom example will ‘broadcast’ and in reality ANY module can get the data it’s sending out.
Hope this helps. It’s a really simple process.
Tested NOAA 3 and it’s still working with the following providers:
Darksky [BUT will at some point stop working as they are going to a pay service and you can no longer get free keys]
Weatherbit
Weatherunlocked
Accuweather
Openweather
Coming soon ClimaCell
** will be working on over the weekend and hopefully can get it working and done **