npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nubert-bluetooth

v0.1.0

Published

Bluetooth control of Nubert nuPro X speakers

Downloads

2

Readme

Nubert Bluetooth Control 🔊

Bluetooth control of Nubert nuPro X speakers using Node.js. For implementing similar controls in other languages, the bluetooth codes are listed in the constants.js file. Tested with Node v8.

Installation

npm install nubert-bluetooth

Getting Started


// Specify local name of the speaker (same as in the nuPro App)
var nubert = require('./index.js')({
    localName: 'nubert X-4 8C12',
});

// Connect via Bluetooth LE
nubert.connect(() => console.log('connected'));

// After connection is etablished...
nubert.setSource('aux');
nubert.setVolume(-43);

// Read changes (for example from the remote control)
nubert.subscribe(event => {
    if (event['type'] === 'volume') {
        console.log('Volume changed');
    }
});

API


var nubert = require('./index.js')({
    localName: 'nubert X-4 8C12',
});

You need to call the connect method first.


nubert.connect(() => console.log('connected')); // Specify a callback after connection is established

// Disconnect from the speakers
nubert.disconnect();

High-level API

There are a couple of high-level APIs for controlling the Nubert speakers.

nubert.powerOn();
nubert.powerOff();
nubert.setVolume(-38);
nubert.setMute();
nubert.unsetMute();
nubert.setSource('opto2'); // Possible sources are: 'aux', 'opto1', 'opto2', 'xlr', 'usb', 'port', 'coax1', 'coax2'.

Low-level API

If the high-level API is not sufficient for your needs, you can use the low-level API. Then, you can control everything that can be controled also via the nuPro app or the infrared remote.

Constants

A list of all bluetooth flags / constants can be found in the constants.js file.

Send


nubert.send(type, command);

// Some examples using constants:
nubert.send(nubert.BASS_ADJUST_SET, 0x16);
nubert.send(nubert.DISPLAY_LIGHT_SET, nubert.SET_FALSE);

Subscribe


nubert.subscribe(callback(data));

// Some examples using constants:
nubert.subscribe((data) => {
    console.log('read:', data);
    if (data['type_raw'] === nubert.DISPLAY_LIGHT_GET) {
        console.log('Somebody changed the display light setting.');
    }
});

License

Nubert-Bluetooth is under the MIT License.