Fixed issue where not all lights are used for chase

This commit is contained in:
watsonb8 2020-04-17 23:32:15 -04:00
parent 756bc3c2b6
commit fb63f3cf52

View File

@ -62,7 +62,6 @@ export class Chase implements IAccessory {
'lightbulbService' 'lightbulbService'
) )
this.getLights();
this._lightbulbService.getCharacteristic(Characteristic.On) this._lightbulbService.getCharacteristic(Characteristic.On)
//@ts-ignore //@ts-ignore
.on("set", this.onPowerSet) .on("set", this.onPowerSet)
@ -95,7 +94,7 @@ export class Chase implements IAccessory {
*/ */
private onPowerSet = async (activeState: boolean, callback: (error?: Error | null | undefined) => void) => { private onPowerSet = async (activeState: boolean, callback: (error?: Error | null | undefined) => void) => {
if (this._isActive != activeState) { if (this._isActive != activeState) {
activeState ? this.chase() : this.stopAndSetOff(); activeState ? this.chase() : this.stop();
} }
return callback(); return callback();
} }