Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. var Cylon = require('cylon');
  2.  
  3. Cylon.api({
  4. host: process.env.HOST || '0.0.0.0',
  5. port: process.env.PORT || '8080',
  6. //ssl: false // tried with and without this
  7. });
  8.  
  9. Cylon.robot({
  10. name: 'pebble',
  11.  
  12. connections: {
  13. pebble: { adapter: 'pebble' }
  14. },
  15.  
  16. devices: {
  17. pebble: { driver: 'pebble' }
  18. },
  19.  
  20. work: function(my) {
  21. my.pebble.send_notification("Hello Pebble!");
  22.  
  23. my.pebble.on('button', function(data) {
  24. console.log('Button Pussed: ', data);
  25. });
  26.  
  27. my.pebble.on('tap', function(data) {
  28. console.log('Tap event detected!');
  29. });
  30. }
  31. }).start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement