Merge branch 'master' of github.com:nathankellenicki/node-poweredup
This commit is contained in:
commit
32fe39fd8c
@ -168,6 +168,7 @@ export class Device extends EventEmitter {
|
||||
}
|
||||
|
||||
public finish (message: number) {
|
||||
if((message & 0x10) === 0x10) return; // "busy/full"
|
||||
this._busy = (message & 0x01) === 0x01;
|
||||
while(this._finishedCallbacks.length > Number(this._busy)) {
|
||||
const callback = this._finishedCallbacks.shift();
|
||||
|
@ -348,14 +348,13 @@ export class LPF2Hub extends BaseHub {
|
||||
|
||||
|
||||
private _parsePortAction (message: Buffer) {
|
||||
|
||||
const portId = message[3];
|
||||
const device = this._getDeviceByPortId(portId);
|
||||
for (let offset = 3; offset < message.length; offset += 2) {
|
||||
const device = this._getDeviceByPortId(message[offset]);
|
||||
|
||||
if (device) {
|
||||
device.finish(message[4]);
|
||||
device.finish(message[offset+1]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user