Read the statement by Michael Teeuw here.
icon + compliments_plus + How to communicate with default weather module ?
-
https://github.com/hangorazvan/compliments_plus
Hi, I love that module but I thought that is beyond on default compliment module.
I want to use that module to alert weather warns to clients working with current default weather module
Also I have .svg icon set for each situation. The only thing I want to show image and text depending on current weather.
For ınstance if it is rainy , the module will show image + rainy text
How can achieve this ?
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); } },
-
How can I connect the Compliments Module with the Weather Module for weather-controlled display of compliments?
I know there’s a line currentWeatherType: ""in compliments.js but I don’t know what I have to insert in there. -
This post is deleted! -
@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!