Pebble


Allows user to interact with Cylon.js devices using a Pebble smart watch.

For more information click here.

How To Connect

Cylon.api({
  host: '0.0.0.0',
  port: '8080',
  ssl:  false
});

Cylon.robot({
  name: 'pebble',

  connections: {
    pebble: { adaptor: 'pebble' }
  },

  devices: {
    pebble: { driver: 'pebble' }
  },

});

How To Use

var Cylon = require('cylon');

Cylon.api({
  host: '0.0.0.0',
  port: '8080',
  ssl:  false
});

Cylon.robot({
  name: 'pebble',

  connections: {
    pebble: { adaptor: 'pebble' }
  },

  devices: {
    pebble: { driver: 'pebble' }
  },

  work: function(my) {
    my.pebble.send_notification("Hello Pebble!");

    my.pebble.on('button', function(data) {
      console.log("Button pushed: " + data);
    });
  }

});

Cylon.start();

Commands

send_notification

Sends a notification to the Pebble

Params

  • message (String) notification to write

Returns

  • (String) message

message_queue

Returns the current message queue

Returns

  • (Array.<String>) message queue

pending_message

Checks if there are pending messages

Returns

  • (String null) message

publish_event

Emits an event, with the supplied data

Params

  • name (String) name of the event to emit

  • data (Object) any payload that should be emitted with the event

Returns

  • (undefined)

Events

button

Emitted when a Pebble button is pushed.


accel

Emitted when an accelerometer event is triggered in the Pebble.


tap

Emitted when the Pebble detects a tap.

Compatibility