I always missed a simple GUI to access the variables, functions and events of my Spark devices. I’m not sure if such a tool exists already, but I have created one:
It’s written in JavaScript using Bootstrap for a responsive design and AngularJS.
You can use it on your desktop PC, tablet or smartphone.
Maybe it will be useful for some of you, so I just want to share it here. However, I’m not sure if this is the correct category as this is no hardware project.
Congratulations André ! Much like the app ! I’ve used and worked perfeitamene .
I think you can help me with a solution!
Managed to put two variables in the clouds , only the html page can only read one. Below as code 'm trying to do :
André this is really great work. I am new with JavaScript. What if i wanted to make a function in your app.js that would target a specific spark function and then call that function on the tpl page directly using a button.
ex Spark function name is Switch and the argument is on.
it’s nice to see that my project might help you. I’m planning a kind of “plugin support” which allows to create templates with custom buttons etc for your applications. But as this is not yet finished. I can help you here with a more or less dirty hack.
You can edit tpl/devices.tpl.html and search for the comment <!-- functions -->. There you can insert the following code:
<button clasS="btn" ng-click="callFunction(device.id, 'Switch', 'on')">Turn it on!</button>
This will actually call the method defined in js/app.js on line 319: $scope.callFunction = ....
You can take this as example to define other AngularJS methods.
I hope this can help you a bit. Feel free to ask more
I’m sorry, but I cannot understand your question. If it has nothing to do with this project, you might want to create a new topic an give a more detailed description of your code and problem? I’ll have a look at it
Thanks for the input. I kind of did what you said by a little trial and error. Could we assign an apple style toggle switch button using bootstrap and angular js?
I also created a new page to kind of make a dashboard for manual controls with pre defined buttons. Also a place where the published functions are updated in a box instead of a stream.
I did some further digging and got it to work with the example found on this page. However i can only work one state from the switch. Either on or off. I know im doing something wrong.
I have been working on your webapp and building a dash on top of it. I see your eventsCtrl gets all the events being published on repeat. What would be the best way to publish specific event names?
Any help you can provide will be highly appreciated.