Merge pull request #36 from nutki/pr-4

allow switching to mode 0 in Hub.subscribe()
This commit is contained in:
Nathan Kellenicki 2019-11-10 12:30:40 -08:00 committed by GitHub
commit 3dc1076a88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,7 +149,7 @@ export class Hub extends EventEmitter {
public subscribe (port: string, mode?: number) {
return new Promise((resolve, reject) => {
let newMode = this._getModeForDeviceType(this._portLookup(port).type);
if (mode) {
if (mode !== undefined) {
newMode = mode;
}
this._activatePortDevice(this._portLookup(port).value, this._portLookup(port).type, newMode, 0x00, () => {