@Squawk09 - it is not a requirement to log when receiving notifications, but it can be useful when debugging. To prove you are receiving the notification, change the line to Log.log('The current temperature is ' + this.temp); and look in the browsers console and you should see the temperature displayed when it is sent from the current weather module.
Once you have confirmed that your module is receiving the notifications, you can then move on to displaying the temperature.
The trick is to understand the sequence of events that occur and how they affect your module. In your case the functions in your modules are currently fired in the following order:
start
notificationReceived (ALL_MODULES_STARTED)
getDom
notificationReceived (DOM_OBJECTS_CREATED)
notificationReceived (Temperature)
The result is that your getDom function is called before the Temperature notification is received, so this.temp hasn’t been set yet.
Since you cannot control the order in which the modules are loaded, or when the Temperature notification is sent by the current weather module, you need to tell your module to call the getDom function again, after the Temperature notification has been received.
To do this, change your notificationReceived function to
notificationReceived: function(notification, payload, sender) {
if (notification === 'Temperature' && sender.name === 'currentweather') {
var currentweather = payload;
if ( currentweather && currentweather.hasOwnProperty('temperature') ) {
this.temp = currentweather.temperature;
this.updateDom();
Log.log('The current temperature is ' + this.temp);
}
}
},
Check out the wiki for documentation, and of course keep asking questions here in these forums :)