moved turn off code for transition
This commit is contained in:
parent
ba95426708
commit
ec624c6773
1 changed files with 8 additions and 1 deletions
|
|
@ -133,13 +133,20 @@ class PlejdService extends EventEmitter {
|
||||||
|
|
||||||
if (i >= steps) {
|
if (i >= steps) {
|
||||||
clearInterval(transitionRef);
|
clearInterval(transitionRef);
|
||||||
|
|
||||||
|
// finally, we turn it off
|
||||||
|
this._turnOff(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this._turnOff(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// finally, we turn it off
|
_turnOff(id) {
|
||||||
var payload = Buffer.from((id).toString(16).padStart(2, '0') + '0110009700', 'hex');
|
var payload = Buffer.from((id).toString(16).padStart(2, '0') + '0110009700', 'hex');
|
||||||
this.write(payload);
|
this.write(payload);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue