Read the statement by Michael Teeuw here.
icon + compliments_plus + How to communicate with default weather module ?
-
@hango the answer to your question in the issue
I see these code , but unable to undesrtand who is sending notification. notificationReceived: function(notification, payload, sender) { if (notification === "Weather data") { this.setCurrentWeatherType(payload.data); } },
any module can send this notification. IF the weather module RECEIVES this notification, it expects an object in the payload with an element called ‘data’
{ data:some-value}
where I guess some_value would be the compliments tags, ‘sunny’, … etc
-
This post is deleted! -
Guys, thanks for assisting me but I think the problem in my weather.js, because I guess it is not sending any notification to client side.
love that module, but unable to find node_helper.js inside of default/weather directory.
I would like to send notification to client side into this compliment in order to listen and put appropriate text for current weather.
this compliment module have this
notificationReceived: function(notification, payload, sender) {
if (notification === “CURRENTWEATHER_DATA”) {
console.log(“251”, payload.data);
this.setCurrentWeatherType(payload.data);
}But I dont get how to send data from my weather module.
Sorry for mixed up
-
@emrah_asl don’t need node_helper, and can’t use node_helper. it can only handle socketNotifcations
this.sendNotification(type, data)
from modulename.js -
This post is deleted! -
Hi, thanks for assisting me.
The problem is I’M not using original weather module, so unable to send notification .
I’m using this one :
https://github.com/MatthiPi/MMM-DefaultWeatherAnimated
{ module: "weather", //change to weather position: "top_right", config: { // See 'Configuration options' for more information. type: 'current', weatherEndpoint: '/weather', units: 'metric', apiKey: 'X', locationID: Y } }, But unable to figure out how to send notification to current weather objects into this compliment_modules. (where should I write , this code in this module ?) when I try in provider.js, console says "sender should be module" this.sendNotification("CURRENTWEATHER_DATA", {foo: "bar"}); MY COMPLIMENT_PLUS Modul compliment_plus.js notificationReceived: function(notification, payload, sender) { if (notification === "CURRENTWEATHER_DATA") { console.log("251", payload.data); this.setCurrentWeatherType(payload.data); } },
-
This post is deleted!