Docs for different classes
This commit is contained in:
parent
866d1f6d7d
commit
2665879d19
12
DOCS.md
12
DOCS.md
@ -78,7 +78,6 @@ Emits when a LPF2 Hub device is found.
|
|||||||
* [.uuid](#Hub+uuid)
|
* [.uuid](#Hub+uuid)
|
||||||
* [.rssi](#Hub+rssi)
|
* [.rssi](#Hub+rssi)
|
||||||
* [.batteryLevel](#Hub+batteryLevel)
|
* [.batteryLevel](#Hub+batteryLevel)
|
||||||
* [.current](#Hub+current)
|
|
||||||
* [.setLEDColor(color)](#WeDo2Hub+setLEDColor) ⇒ <code>Promise</code>
|
* [.setLEDColor(color)](#WeDo2Hub+setLEDColor) ⇒ <code>Promise</code>
|
||||||
* [.setLEDRGB(red, green, blue)](#WeDo2Hub+setLEDRGB) ⇒ <code>Promise</code>
|
* [.setLEDRGB(red, green, blue)](#WeDo2Hub+setLEDRGB) ⇒ <code>Promise</code>
|
||||||
* [.setMotorSpeed(port, speed, [time])](#WeDo2Hub+setMotorSpeed) ⇒ <code>Promise</code>
|
* [.setMotorSpeed(port, speed, [time])](#WeDo2Hub+setMotorSpeed) ⇒ <code>Promise</code>
|
||||||
@ -146,17 +145,6 @@ The WeDo2Hub is emitted if the discovered device is a WeDo 2.0 Smart Hub.
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| batteryLevel | <code>number</code> | Battery level of the hub (Percentage between 0-100) |
|
| batteryLevel | <code>number</code> | Battery level of the hub (Percentage between 0-100) |
|
||||||
|
|
||||||
<a name="Hub+current"></a>
|
|
||||||
|
|
||||||
### weDo2Hub.current
|
|
||||||
**Kind**: instance property of [<code>WeDo2Hub</code>](#WeDo2Hub)
|
|
||||||
**Read only**: true
|
|
||||||
**Properties**
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| current | <code>number</code> | Current usage of the hub (Amps) |
|
|
||||||
|
|
||||||
<a name="WeDo2Hub+setLEDColor"></a>
|
<a name="WeDo2Hub+setLEDColor"></a>
|
||||||
|
|
||||||
### weDo2Hub.setLEDColor(color) ⇒ <code>Promise</code>
|
### weDo2Hub.setLEDColor(color) ⇒ <code>Promise</code>
|
||||||
|
12
README.md
12
README.md
@ -128,7 +128,6 @@ Emits when a LPF2 Hub device is found.
|
|||||||
* [.uuid](#Hub+uuid)
|
* [.uuid](#Hub+uuid)
|
||||||
* [.rssi](#Hub+rssi)
|
* [.rssi](#Hub+rssi)
|
||||||
* [.batteryLevel](#Hub+batteryLevel)
|
* [.batteryLevel](#Hub+batteryLevel)
|
||||||
* [.current](#Hub+current)
|
|
||||||
* [.setLEDColor(color)](#WeDo2Hub+setLEDColor) ⇒ <code>Promise</code>
|
* [.setLEDColor(color)](#WeDo2Hub+setLEDColor) ⇒ <code>Promise</code>
|
||||||
* [.setLEDRGB(red, green, blue)](#WeDo2Hub+setLEDRGB) ⇒ <code>Promise</code>
|
* [.setLEDRGB(red, green, blue)](#WeDo2Hub+setLEDRGB) ⇒ <code>Promise</code>
|
||||||
* [.setMotorSpeed(port, speed, [time])](#WeDo2Hub+setMotorSpeed) ⇒ <code>Promise</code>
|
* [.setMotorSpeed(port, speed, [time])](#WeDo2Hub+setMotorSpeed) ⇒ <code>Promise</code>
|
||||||
@ -196,17 +195,6 @@ The WeDo2Hub is emitted if the discovered device is a WeDo 2.0 Smart Hub.
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| batteryLevel | <code>number</code> | Battery level of the hub (Percentage between 0-100) |
|
| batteryLevel | <code>number</code> | Battery level of the hub (Percentage between 0-100) |
|
||||||
|
|
||||||
<a name="Hub+current"></a>
|
|
||||||
|
|
||||||
### weDo2Hub.current
|
|
||||||
**Kind**: instance property of [<code>WeDo2Hub</code>](#WeDo2Hub)
|
|
||||||
**Read only**: true
|
|
||||||
**Properties**
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| current | <code>number</code> | Current usage of the hub (Amps) |
|
|
||||||
|
|
||||||
<a name="WeDo2Hub+setLEDColor"></a>
|
<a name="WeDo2Hub+setLEDColor"></a>
|
||||||
|
|
||||||
### weDo2Hub.setLEDColor(color) ⇒ <code>Promise</code>
|
### weDo2Hub.setLEDColor(color) ⇒ <code>Promise</code>
|
||||||
|
10
hub.ts
10
hub.ts
@ -26,7 +26,6 @@ export class Hub extends EventEmitter {
|
|||||||
|
|
||||||
protected _name: string;
|
protected _name: string;
|
||||||
protected _batteryLevel: number = 100;
|
protected _batteryLevel: number = 100;
|
||||||
protected _current: number = 0;
|
|
||||||
|
|
||||||
private _peripheral: Peripheral;
|
private _peripheral: Peripheral;
|
||||||
private _uuid: string;
|
private _uuid: string;
|
||||||
@ -77,15 +76,6 @@ export class Hub extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @readonly
|
|
||||||
* @property {number} current Current usage of the hub (Amps)
|
|
||||||
*/
|
|
||||||
public get current () {
|
|
||||||
return this._current;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connect to the Hub.
|
* Connect to the Hub.
|
||||||
* @method Hub#connect
|
* @method Hub#connect
|
||||||
|
11
lpf2hub.ts
11
lpf2hub.ts
@ -17,12 +17,23 @@ const debug = Debug("lpf2hub");
|
|||||||
export class LPF2Hub extends Hub {
|
export class LPF2Hub extends Hub {
|
||||||
|
|
||||||
|
|
||||||
|
protected _current: number = 0;
|
||||||
|
|
||||||
private _lastTiltX: number = 0;
|
private _lastTiltX: number = 0;
|
||||||
private _lastTiltY: number = 0;
|
private _lastTiltY: number = 0;
|
||||||
|
|
||||||
private _messageBuffer: Buffer = Buffer.alloc(0);
|
private _messageBuffer: Buffer = Buffer.alloc(0);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @readonly
|
||||||
|
* @property {number} current Current usage of the hub (Amps)
|
||||||
|
*/
|
||||||
|
public get current () {
|
||||||
|
return this._current;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public connect () {
|
public connect () {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
await super.connect();
|
await super.connect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user