So, for my next step I’ll be creating my own module, acting as the proxy for the Alexa feedback. All it’s supposed to do is capture the commands and the content sent by Amazon, and act accordingly… based on some configuration of course.
So the first thing to do is create an extra folder, and create a .js file and a node helper. You can find all the info about that in the Magic Mirror Builders section on creating your own module here.
The result in Atom looks like this :
So, below is the contents of my js file. I’ve implemented a very simple start function. Just updating the DOM every minute.
The node helper code is fairly simple. The start function override just starts a routing from the express framework, just like in our tests before. All it does is send a socket notification to the front end where it is handled.
All we need to do now is add it to the configuration of the mirror like in the screenshot below. I’ve got no specific settings up until now, it’s also fairly simple.
Starting up the debug hub, and pressing the buttons. Here’s the result. Exactly what I was hoping for.