Socket
Socket
Sign inDemoInstall

bluetooth-bulb

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bluetooth-bulb

A node.js library for the BluetoothBulb


Version published
Weekly downloads
4
increased by33.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

node-bluetooth-bulb

A node.js library for the BlueClick Bluetooth Bulb

Special thanks to @mrose17 for sending me a bulb!

Notes:

  • currently only works on Linux, due to the follow issues with CoreBluetooth on OS X:
    • bulb disconnects during characteristic discover
    • cannot write to hande without response

Install

npm install bluetooth-bulb

Usage

var BlueoothBulb = require('bluetooth-bulb');

Discover

BlueoothBulb.discover(callback(bluetoothBulb));

Connect

bluetoothBulb.connect(callback);

Disconnect

bluetoothBulb.disconnect(callback);

Pair

// If pair key has not been set previously, it must be set within 10s of powering the bulb.
// Otherwise, pair must be called, immediately after connect (otherwise the bulb will terminate the connection)

bluetoothBulb.pair(key, callback); // key must be 0 - 255

Get Brightness

// value range is: 0 - 125

bluetoothBulb.getGreenBrightness(callback(value));

bluetoothBulb.getRedBrightness(callback(value));

bluetoothBulb.getWhiteBrightness(callback(value));

bluetoothBulb.getBlueBrightness(callback(value));

Set Brightness

// value range is: 0 - 125

bluetoothBulb.setGreenBrightness(value, callback);

bluetoothBulb.setRedBrightness(value, callback);

bluetoothBulb.setWhiteBrightness(value, callback);

bluetoothBulb.setBlueBrightness(value, callback);

Get Friendly Name

bluetoothBulb.getFriendlyName(callback(friendlyName));

Get Pair Counter

// how many pair keys are there

bluetoothBulb.getPairCounter(callback(pairCounter));

Disconnect Workaround

// no-op, keeps connection alive

bluetoothBulb.disconnectWorkaround(callback);

Get Bulb State

// get the current state of the bulb

bluetoothBulb.getBulbState(callback(bulbState));

Remove Pairs

// Remove all pair keys from the bulb (will need to set a new pair key after operation)

bluetoothBulb.removePairs(callback);

Get Device Name

bluetoothBulb.getDeviceName(callback(deviceName));

Get Model Number

bluetoothBulb.getModelNumber(callback(modelNumber));

Get Firmware Revision

bluetoothBulb.getFirmwareRevision(callback(firmwareRevision));

Get Hardware Revision

bluetoothBulb.getHardwareRevision(callback(hardwareRevision));

Get Manufacturer Name

bluetoothBulb.getManufacturerName(callback(manufacturerName));

Keywords

FAQs

Last updated on 03 Oct 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc