Read the statement by Michael Teeuw here.
Peek-a-boo...
-
As I mentioned earlier, the approach I’ve taken isn’t exactly elegant. It’s the way to go for a HIDE_ALL or SHOW_ALL because obviously all the modules would need to know then, but a more efficient approach would really be to target modules as you need them - that involved reworking the voicecontrol.js or node-helper though and passing two variables - the notification and the target module. I just wasn’t confident enough to do this yet.
-
@darrene thank you for sharing your calendar.js file because that is where I found where the issue was…it was the name for the function notificationReceived: – needed to have a lower case “n”.
Now it works perfectly!! And as you predicted I experienced a massive grin.
update:
I’ve been testing this out with other modules and it works like a charm. I also discovered (after trial and error) that its possible to combine the hide/show with the hide all/show all command simply by revising the if statement on the notificationReceived function with an “or” condition specifying both commands . See below is an example of the revised code:notificationReceived: function(notification, payload, sender) {
if (notification === “HIDE_CALENDAR” || “HIDE_ALL”) {
this.hide();
} else if (notification === “SHOW_CALENDAR” || “SHOW_ALL”) {
this.show();
}
}, -
@carteblanche said in Peek-a-boo...:
@darrene thank you for sharing your calendar.js file because that is where I found where the issue was…it was the name for the function notificationReceived: – needed to have a lower case “n”.
Now it works perfectly!! And as you predicted I experienced a massive grin.
update:
I’ve been testing this out with other modules and it works like a charm. I also discovered (after trial and error) that its possible to combine the hide/show with the hide all/show all command simply by revising the if statement on the notificationReceived function with an “or” condition specifying both commands . See below is an example of the revised code:notificationReceived: function(notification, payload, sender) {
if (notification === “HIDE_CALENDAR” || “HIDE_ALL”) {
this.hide();
} else if (notification === “SHOW_CALENDAR” || “SHOW_ALL”) {
this.show();
}
},update: while this worked for a short period, upon further testing this code seems to cause some issues with HIDE_ALL auto suspending all modules on launch. So the or condition if statement doesn’t appear to be a viable solution, the only way to include hide/show all is the way you have the code now @darrene with the multiple else if statements.
-
if (notification === "HIDE_CALENDAR" || "HIDE_ALL") this will be always true: notification === "HIDE_CALENDAR" can be true or false, but "HIDE_ALL" will be always true
that’s why it always hide the module
it must be like that
if (notification === "HIDE_CALENDAR" || notification === "HIDE_ALL") { this.hide(); } else if (notification === "SHOW_CALENDAR" || notification === "SHOW_ALL") { this.show(); } },
-
@strawberry-3.141 Thank you for the tip! Now it makes perfect sense.
It does still work with the multiple else if statements but for the sake of cleaner code I like the idea of using the or condition.
-
Apologies for the typo in notification @carteblanche - I should have copied and pasted the code originally, rather than typing it off the the top of my head!
Glad to read that you managed to sort it though. Nice work :)
-
@darrene hey no worries at all on the typo. I can’t thank you enough for helping out and providing the comprehensive step-by-step guide in plain english to noobs like me. I don’t know how I would have got the voice module working without your help so thanks again!
-
@darrene I think you a lot for your help.
i get it work with all module that I have :-)
Your descpition was very helpfull. thanks again . -
Q : have you managed to get Alexia working alongside another ‘bot/ai’?
Any instructions for install? Many thanks!