Emit attach event any case
This commit is contained in:
parent
2482422302
commit
55bcafa637
14
src/hub.ts
14
src/hub.ts
@ -269,14 +269,14 @@ export class Hub extends EventEmitter {
|
|||||||
port.type = type;
|
port.type = type;
|
||||||
if (this.autoSubscribe) {
|
if (this.autoSubscribe) {
|
||||||
this._activatePortDevice(port.value, type, this._getModeForDeviceType(type), 0x00);
|
this._activatePortDevice(port.value, type, this._getModeForDeviceType(type), 0x00);
|
||||||
/**
|
|
||||||
* Emits when a motor or sensor is attached to the Hub.
|
|
||||||
* @event Hub#attach
|
|
||||||
* @param {string} port
|
|
||||||
* @param {DeviceType} type
|
|
||||||
*/
|
|
||||||
this.emit("attach", port.id, type);
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Emits when a motor or sensor is attached to the Hub.
|
||||||
|
* @event Hub#attach
|
||||||
|
* @param {string} port
|
||||||
|
* @param {DeviceType} type
|
||||||
|
*/
|
||||||
|
this.emit("attach", port.id, type);
|
||||||
} else {
|
} else {
|
||||||
port.type = Consts.DeviceType.UNKNOWN;
|
port.type = Consts.DeviceType.UNKNOWN;
|
||||||
debug(`Port ${port.id} disconnected`);
|
debug(`Port ${port.id} disconnected`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user