diff --git a/DOCS.md b/DOCS.md index 5c38cde..ee1b98c 100644 --- a/DOCS.md +++ b/DOCS.md @@ -20,7 +20,7 @@
Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["button" (button, state)](#WeDo2SmartHub+event_button)
* ["distance" (port, distance)](#WeDo2SmartHub+event_distance)
* ["color" (port, color)](#WeDo2SmartHub+event_color)
@@ -337,7 +337,7 @@ Get the hub type.
**Kind**: instance method of [WeDo2SmartHub
](#WeDo2SmartHub)
-### weDo2SmartHub.getPortDeviceType(port) ⇒ DeviceType
+### weDo2SmartHub.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [WeDo2SmartHub
](#WeDo2SmartHub)
@@ -417,7 +417,7 @@ Emits when a motor or sensor is attached to the Hub.
| Param | Type |
| --- | --- |
| port | string
|
-| type | DeviceType
|
+| type | [DeviceType
](#DeviceType) |
@@ -457,7 +457,7 @@ Emits when an attached motor or sensor is detached from the Hub.
* [.sleep(delay)](#Hub+sleep) ⇒ Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["button" (button, state)](#LPF2Hub+event_button)
* ["distance" (port, distance)](#LPF2Hub+event_distance)
* ["color" (port, color)](#LPF2Hub+event_color)
@@ -708,7 +708,7 @@ Get the hub type.
**Overrides**: [getHubType
](#Hub+getHubType)
-### boostMoveHub.getPortDeviceType(port) ⇒ DeviceType
+### boostMoveHub.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [BoostMoveHub
](#BoostMoveHub)
@@ -803,7 +803,7 @@ Emits when a motor or sensor is attached to the Hub.
| Param | Type |
| --- | --- |
| port | string
|
-| type | DeviceType
|
+| type | [DeviceType
](#DeviceType) |
@@ -843,7 +843,7 @@ Emits when an attached motor or sensor is detached from the Hub.
* [.sleep(delay)](#Hub+sleep) ⇒ Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["button" (button, state)](#LPF2Hub+event_button)
* ["distance" (port, distance)](#LPF2Hub+event_distance)
* ["color" (port, color)](#LPF2Hub+event_color)
@@ -1079,7 +1079,7 @@ Get the hub type.
**Overrides**: [getHubType
](#Hub+getHubType)
-### pupHub.getPortDeviceType(port) ⇒ DeviceType
+### pupHub.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [PUPHub
](#PUPHub)
@@ -1162,7 +1162,7 @@ Emits when a motor or sensor is attached to the Hub.
| Param | Type |
| --- | --- |
| port | string
|
-| type | DeviceType
|
+| type | [DeviceType
](#DeviceType) |
@@ -1199,7 +1199,7 @@ Emits when an attached motor or sensor is detached from the Hub.
* [.sleep(delay)](#Hub+sleep) ⇒ Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["button" (button, state)](#LPF2Hub+event_button)
* ["colorAndDistance" (port, color, distance)](#LPF2Hub+event_colorAndDistance)
@@ -1389,7 +1389,7 @@ Get the hub type.
**Overrides**: [getHubType
](#Hub+getHubType)
-### pupRemote.getPortDeviceType(port) ⇒ DeviceType
+### pupRemote.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [PUPRemote
](#PUPRemote)
@@ -1450,7 +1450,7 @@ A combined color and distance event, emits when the sensor is activated.
* [.sleep(delay)](#Hub+sleep) ⇒ Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["color" (port, color)](#LPF2Hub+event_color)
* ["colorAndDistance" (port, color, distance)](#LPF2Hub+event_colorAndDistance)
* ["speed" (port, speed)](#LPF2Hub+event_speed)
@@ -1681,7 +1681,7 @@ Get the hub type.
**Overrides**: [getHubType
](#Hub+getHubType)
-### duploTrainBase.getPortDeviceType(port) ⇒ DeviceType
+### duploTrainBase.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [DuploTrainBase
](#DuploTrainBase)
@@ -1743,9 +1743,9 @@ Emits on a speed change.
| POWERED_UP_REMOTE | number
| 4 |
| DUPLO_TRAIN_HUB | number
| 5 |
-
+
-## Device
+## DeviceType
**Kind**: global typedef
**Properties**
diff --git a/README.md b/README.md
index a693fd5..0db6bdc 100644
--- a/README.md
+++ b/README.md
@@ -103,7 +103,7 @@ Thanks go to Jorge Pereira ([@JorgePe](https://github.com/JorgePe)), Sebastian R
Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["button" (button, state)](#WeDo2SmartHub+event_button)
* ["distance" (port, distance)](#WeDo2SmartHub+event_distance)
* ["color" (port, color)](#WeDo2SmartHub+event_color)
@@ -420,7 +420,7 @@ Get the hub type.
**Kind**: instance method of [WeDo2SmartHub
](#WeDo2SmartHub)
-### weDo2SmartHub.getPortDeviceType(port) ⇒ DeviceType
+### weDo2SmartHub.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [WeDo2SmartHub
](#WeDo2SmartHub)
@@ -500,7 +500,7 @@ Emits when a motor or sensor is attached to the Hub.
| Param | Type |
| --- | --- |
| port | string
|
-| type | DeviceType
|
+| type | [DeviceType
](#DeviceType) |
@@ -540,7 +540,7 @@ Emits when an attached motor or sensor is detached from the Hub.
* [.sleep(delay)](#Hub+sleep) ⇒ Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["button" (button, state)](#LPF2Hub+event_button)
* ["distance" (port, distance)](#LPF2Hub+event_distance)
* ["color" (port, color)](#LPF2Hub+event_color)
@@ -791,7 +791,7 @@ Get the hub type.
**Overrides**: [getHubType
](#Hub+getHubType)
-### boostMoveHub.getPortDeviceType(port) ⇒ DeviceType
+### boostMoveHub.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [BoostMoveHub
](#BoostMoveHub)
@@ -886,7 +886,7 @@ Emits when a motor or sensor is attached to the Hub.
| Param | Type |
| --- | --- |
| port | string
|
-| type | DeviceType
|
+| type | [DeviceType
](#DeviceType) |
@@ -926,7 +926,7 @@ Emits when an attached motor or sensor is detached from the Hub.
* [.sleep(delay)](#Hub+sleep) ⇒ Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["button" (button, state)](#LPF2Hub+event_button)
* ["distance" (port, distance)](#LPF2Hub+event_distance)
* ["color" (port, color)](#LPF2Hub+event_color)
@@ -1162,7 +1162,7 @@ Get the hub type.
**Overrides**: [getHubType
](#Hub+getHubType)
-### pupHub.getPortDeviceType(port) ⇒ DeviceType
+### pupHub.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [PUPHub
](#PUPHub)
@@ -1245,7 +1245,7 @@ Emits when a motor or sensor is attached to the Hub.
| Param | Type |
| --- | --- |
| port | string
|
-| type | DeviceType
|
+| type | [DeviceType
](#DeviceType) |
@@ -1282,7 +1282,7 @@ Emits when an attached motor or sensor is detached from the Hub.
* [.sleep(delay)](#Hub+sleep) ⇒ Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["button" (button, state)](#LPF2Hub+event_button)
* ["colorAndDistance" (port, color, distance)](#LPF2Hub+event_colorAndDistance)
@@ -1472,7 +1472,7 @@ Get the hub type.
**Overrides**: [getHubType
](#Hub+getHubType)
-### pupRemote.getPortDeviceType(port) ⇒ DeviceType
+### pupRemote.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [PUPRemote
](#PUPRemote)
@@ -1533,7 +1533,7 @@ A combined color and distance event, emits when the sensor is activated.
* [.sleep(delay)](#Hub+sleep) ⇒ Promise
* [.wait(commands)](#Hub+wait) ⇒ Promise
* [.getHubType()](#Hub+getHubType) ⇒ [HubType
](#HubType)
- * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ DeviceType
+ * [.getPortDeviceType(port)](#Hub+getPortDeviceType) ⇒ [DeviceType
](#DeviceType)
* ["color" (port, color)](#LPF2Hub+event_color)
* ["colorAndDistance" (port, color, distance)](#LPF2Hub+event_colorAndDistance)
* ["speed" (port, speed)](#LPF2Hub+event_speed)
@@ -1764,7 +1764,7 @@ Get the hub type.
**Overrides**: [getHubType
](#Hub+getHubType)
-### duploTrainBase.getPortDeviceType(port) ⇒ DeviceType
+### duploTrainBase.getPortDeviceType(port) ⇒ [DeviceType
](#DeviceType)
Get the device type for a given port.
**Kind**: instance method of [DuploTrainBase
](#DuploTrainBase)
@@ -1826,9 +1826,9 @@ Emits on a speed change.
| POWERED_UP_REMOTE | number
| 4 |
| DUPLO_TRAIN_HUB | number
| 5 |
-
+
-## Device
+## DeviceType
**Kind**: global typedef
**Properties**
diff --git a/consts.ts b/consts.ts
index c57367b..4798705 100644
--- a/consts.ts
+++ b/consts.ts
@@ -18,7 +18,7 @@ export enum HubType {
/**
- * @typedef Device
+ * @typedef DeviceType
* @property {number} UNKNOWN 0
* @property {number} BASIC_MOTOR 1
* @property {number} TRAIN_MOTOR 2
diff --git a/package.json b/package.json
index 4a85221..6edaafe 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "node-poweredup",
- "version": "1.4.0",
+ "version": "1.4.1",
"description": "A Node.js module to interface with LEGO Powered UP components.",
"homepage": "https://github.com/nathankellenicki/node-poweredup/",
"main": "dist/index.js",