diff --git a/DOCS.md b/DOCS.md index f3dbad5..ddd8f55 100644 --- a/DOCS.md +++ b/DOCS.md @@ -5,6 +5,12 @@
Hub
LPF2Hub
LPF2Hub
LPF2Hub
string
|
+
+
+## BoostMoveHub ⇐ LPF2Hub
+**Kind**: global class
+**Extends**: LPF2Hub
+
+* [BoostMoveHub](#BoostMoveHub) ⇐ LPF2Hub
+ * [new BoostMoveHub()](#new_BoostMoveHub_new)
+ * [.setLEDColor(color)](#BoostMoveHub+setLEDColor) ⇒ Promise
+ * [.setMotorSpeed(port, speed, [time])](#BoostMoveHub+setMotorSpeed) ⇒ Promise
+ * [.setMotorAngle(port, angle, [speed])](#BoostMoveHub+setMotorAngle) ⇒ Promise
+
+
+
+### new BoostMoveHub()
+The BoostMoveHub is emitted if the discovered device is a Boost Move Hub.
+
+
+
+### boostMoveHub.setLEDColor(color) ⇒ Promise
+Set the color of the LED on the Hub via a color value.
+
+**Kind**: instance method of [BoostMoveHub
](#BoostMoveHub)
+**Returns**: Promise
- Resolved upon successful issuance of command.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| color | number
| A number representing one of the LED color consts. |
+
+
+
+### boostMoveHub.setMotorSpeed(port, speed, [time]) ⇒ Promise
+Set the motor speed on a given port.
+
+**Kind**: instance method of [BoostMoveHub
](#BoostMoveHub)
+**Returns**: Promise
- Resolved upon successful completion of command. If time is specified, this is once the motor is finished.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| port | string
| |
+| speed | number
| For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0. |
+| [time] | number
| How long to activate the motor for (in milliseconds). Leave empty to turn the motor on indefinitely. |
+
+
+
+### boostMoveHub.setMotorAngle(port, angle, [speed]) ⇒ Promise
+Rotate a motor by a given angle.
+
+**Kind**: instance method of [BoostMoveHub
](#BoostMoveHub)
+**Returns**: Promise
- Resolved upon successful completion of command (ie. once the motor is finished).
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| port | string
| | |
+| angle | number
| | How much the motor should be rotated (in degrees). |
+| [speed] | number
| 100
| How fast the motor should be rotated. |
+
+
+
+## PUPHub ⇐ LPF2Hub
+**Kind**: global class
+**Extends**: LPF2Hub
+
+* [PUPHub](#PUPHub) ⇐ LPF2Hub
+ * [new PUPHub()](#new_PUPHub_new)
+ * [.setLEDColor(color)](#PUPHub+setLEDColor) ⇒ Promise
+ * [.setMotorSpeed(port, speed, [time])](#PUPHub+setMotorSpeed) ⇒ Promise
+
+
+
+### new PUPHub()
+The PUPHub is emitted if the discovered device is a Powered Up Hub.
+
+
+
+### pupHub.setLEDColor(color) ⇒ Promise
+Set the color of the LED on the Hub via a color value.
+
+**Kind**: instance method of [PUPHub
](#PUPHub)
+**Returns**: Promise
- Resolved upon successful issuance of command.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| color | number
| A number representing one of the LED color consts. |
+
+
+
+### pupHub.setMotorSpeed(port, speed, [time]) ⇒ Promise
+Set the motor speed on a given port.
+
+**Kind**: instance method of [PUPHub
](#PUPHub)
+**Returns**: Promise
- Resolved upon successful completion of command. If time is specified, this is once the motor is finished.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| port | string
| |
+| speed | number
| For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0. |
+| [time] | number
| How long to activate the motor for (in milliseconds). Leave empty to turn the motor on indefinitely. |
+
+
+
+## PUPRemote ⇐ LPF2Hub
+**Kind**: global class
+**Extends**: LPF2Hub
+
+* [PUPRemote](#PUPRemote) ⇐ LPF2Hub
+ * [new PUPRemote()](#new_PUPRemote_new)
+ * [.setLEDColor(color)](#PUPRemote+setLEDColor) ⇒ Promise
+
+
+
+### new PUPRemote()
+The PUPRemote is emitted if the discovered device is a Powered Up Remote.
+
+
+
+### pupRemote.setLEDColor(color) ⇒ Promise
+Set the color of the LED on the Remote via a color value.
+
+**Kind**: instance method of [PUPRemote
](#PUPRemote)
+**Returns**: Promise
- Resolved upon successful issuance of command.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| color | number
| A number representing one of the LED color consts. |
+
diff --git a/README.md b/README.md
index a61fa75..a6f8bf5 100644
--- a/README.md
+++ b/README.md
@@ -55,6 +55,12 @@ Thanks go to Jorge Pereira ([@JorgePe](https://github.com/JorgePe)), Sebastian R
Hub
LPF2Hub
LPF2Hub
LPF2Hub
string
|
+
+
+## BoostMoveHub ⇐ LPF2Hub
+**Kind**: global class
+**Extends**: LPF2Hub
+
+* [BoostMoveHub](#BoostMoveHub) ⇐ LPF2Hub
+ * [new BoostMoveHub()](#new_BoostMoveHub_new)
+ * [.setLEDColor(color)](#BoostMoveHub+setLEDColor) ⇒ Promise
+ * [.setMotorSpeed(port, speed, [time])](#BoostMoveHub+setMotorSpeed) ⇒ Promise
+ * [.setMotorAngle(port, angle, [speed])](#BoostMoveHub+setMotorAngle) ⇒ Promise
+
+
+
+### new BoostMoveHub()
+The BoostMoveHub is emitted if the discovered device is a Boost Move Hub.
+
+
+
+### boostMoveHub.setLEDColor(color) ⇒ Promise
+Set the color of the LED on the Hub via a color value.
+
+**Kind**: instance method of [BoostMoveHub
](#BoostMoveHub)
+**Returns**: Promise
- Resolved upon successful issuance of command.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| color | number
| A number representing one of the LED color consts. |
+
+
+
+### boostMoveHub.setMotorSpeed(port, speed, [time]) ⇒ Promise
+Set the motor speed on a given port.
+
+**Kind**: instance method of [BoostMoveHub
](#BoostMoveHub)
+**Returns**: Promise
- Resolved upon successful completion of command. If time is specified, this is once the motor is finished.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| port | string
| |
+| speed | number
| For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0. |
+| [time] | number
| How long to activate the motor for (in milliseconds). Leave empty to turn the motor on indefinitely. |
+
+
+
+### boostMoveHub.setMotorAngle(port, angle, [speed]) ⇒ Promise
+Rotate a motor by a given angle.
+
+**Kind**: instance method of [BoostMoveHub
](#BoostMoveHub)
+**Returns**: Promise
- Resolved upon successful completion of command (ie. once the motor is finished).
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| port | string
| | |
+| angle | number
| | How much the motor should be rotated (in degrees). |
+| [speed] | number
| 100
| How fast the motor should be rotated. |
+
+
+
+## PUPHub ⇐ LPF2Hub
+**Kind**: global class
+**Extends**: LPF2Hub
+
+* [PUPHub](#PUPHub) ⇐ LPF2Hub
+ * [new PUPHub()](#new_PUPHub_new)
+ * [.setLEDColor(color)](#PUPHub+setLEDColor) ⇒ Promise
+ * [.setMotorSpeed(port, speed, [time])](#PUPHub+setMotorSpeed) ⇒ Promise
+
+
+
+### new PUPHub()
+The PUPHub is emitted if the discovered device is a Powered Up Hub.
+
+
+
+### pupHub.setLEDColor(color) ⇒ Promise
+Set the color of the LED on the Hub via a color value.
+
+**Kind**: instance method of [PUPHub
](#PUPHub)
+**Returns**: Promise
- Resolved upon successful issuance of command.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| color | number
| A number representing one of the LED color consts. |
+
+
+
+### pupHub.setMotorSpeed(port, speed, [time]) ⇒ Promise
+Set the motor speed on a given port.
+
+**Kind**: instance method of [PUPHub
](#PUPHub)
+**Returns**: Promise
- Resolved upon successful completion of command. If time is specified, this is once the motor is finished.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| port | string
| |
+| speed | number
| For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0. |
+| [time] | number
| How long to activate the motor for (in milliseconds). Leave empty to turn the motor on indefinitely. |
+
+
+
+## PUPRemote ⇐ LPF2Hub
+**Kind**: global class
+**Extends**: LPF2Hub
+
+* [PUPRemote](#PUPRemote) ⇐ LPF2Hub
+ * [new PUPRemote()](#new_PUPRemote_new)
+ * [.setLEDColor(color)](#PUPRemote+setLEDColor) ⇒ Promise
+
+
+
+### new PUPRemote()
+The PUPRemote is emitted if the discovered device is a Powered Up Remote.
+
+
+
+### pupRemote.setLEDColor(color) ⇒ Promise
+Set the color of the LED on the Remote via a color value.
+
+**Kind**: instance method of [PUPRemote
](#PUPRemote)
+**Returns**: Promise
- Resolved upon successful issuance of command.
+
+| Param | Type | Description |
+| --- | --- | --- |
+| color | number
| A number representing one of the LED color consts. |
+
diff --git a/package.json b/package.json
index 3e752b6..a9fd01d 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
"types": "dist/lpf2.d.ts",
"scripts": {
"build": "tslint -c tslint.json \"*.ts\" && tsc",
- "docs": "jsdoc2md dist/lpf2.js dist/lpf2hub.js dist/wedo2hub.js dist/hub.js dist/consts.js > DOCS.md",
+ "docs": "jsdoc2md dist/lpf2.js dist/wedo2hub.js dist/boostmovehub.js dist/puphub.js dist/pupremote.js dist/hub.js dist/consts.js > DOCS.md",
"readme": "cat ABOUT.md DOCS.md > README.md",
"all": "npm run build && npm run docs && npm run readme",
"prepublishOnly": "tsc"