bug fix brightness > 254 toggles back
This commit is contained in:
parent
c8dae032a9
commit
717c17b77e
1 changed files with 6 additions and 1 deletions
|
|
@ -92,7 +92,12 @@ class PlejdService extends EventEmitter {
|
|||
|
||||
let i = 0;
|
||||
const transitionRef = setInterval(() => {
|
||||
this._turnOn(id, parseInt((brightnessStep * i) + 1));
|
||||
let currentBrightness = parseInt((brightnessStep * i) + 1);
|
||||
if (currentBrightness > 254) {
|
||||
currentBrightness = 254;
|
||||
}
|
||||
|
||||
this._turnOn(id, currentBrightness);
|
||||
|
||||
if (i >= steps) {
|
||||
clearInterval(transitionRef);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue