<commit_before># bluelight

A Bluetooth lamp controller library.

## Install

```sh
npm install bluelight
```

## Usage

```javascript
const Bluelight = require('bluelight'),
      bluelight = new Bluelight();
```

### Actions

#### Start scanning

```javascript
bluelight.scanFor(5000); // scan for 5 seconds
```

#### Get list of detected devices

```javascript
for (let device of bluelight.detectedDevices) {
    console.log(device);
}
```

#### Devices

All these methods return a `Promise` which resolve when finished executing the command or reject when an error occured.

##### Enable light

```javascript
device.enableLight().then(function () {
    console.log("Light enabled");
});
```

##### Disable light<commit_msg>Add reference to greenlight in README<commit_after># bluelight

A Bluetooth lamp controller library.

## Install

```sh
npm install bluelight
```

## Usage

```javascript
const Bluelight = require('bluelight'),
      bluelight = new Bluelight();
```

## Example projects using this library

  * [greenlight](https://github.com/mcuelenaere/greenlight): a simple web UI + REST API around bluelight

### Actions

#### Start scanning

```javascript
bluelight.scanFor(5000); // scan for 5 seconds
```

#### Get list of detected devices

```javascript
for (let device of bluelight.detectedDevices) {
    console.log(device);
}
```

#### Devices

All these methods return a `Promise` which resolve when finished executing the command or reject when an error occured.

##### Enable light

```javascript
device.enableLight().then(function () {
    console.log("Light enabled");
});
```

##### Disable light
{'fraction_non_alphanumeric': 0.1434729064039409, 'fraction_numerical': 0.006157635467980296, 'mean_word_length': 4.642361111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3033654', 'n_tokens_mistral': 510, 'n_tokens_neox': 462, 'n_words': 156}