From 2fcf0c89bfc8bc18f8d63c2235255c6154d191c0 Mon Sep 17 00:00:00 2001 From: Brandon Watson Date: Mon, 3 Jan 2022 13:19:16 -0500 Subject: [PATCH] Fixing unresponsiveness issue --- package-lock.json | 2 +- package.json | 2 +- src/chase.ts | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f10ee3..5653abb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@watsonb8/homebridge-hue-chase", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2890e06..ff3cfd0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@watsonb8/homebridge-hue-chase", - "version": "1.1.1", + "version": "1.1.2", "description": "A Phillips Hue add on for creating chase sequences.", "main": "bin/index.js", "publishConfig": { diff --git a/src/chase.ts b/src/chase.ts index 6570d5b..cdd5ead 100644 --- a/src/chase.ts +++ b/src/chase.ts @@ -76,12 +76,14 @@ export class Chase implements IAccessory { .getCharacteristic(Characteristic.On) //@ts-ignore .on("set", this.onPowerSet) + //@ts-ignore .on("get", this.onPowerGet); this._lightbulbService .getCharacteristic(Characteristic.Brightness) //@ts-ignore .on("set", this.onBrightnessSet) + //@ts-ignore .on("get", this.onBrightnessGet); } @@ -117,8 +119,10 @@ export class Chase implements IAccessory { * Handler for switch get event * @param callback The callback function to call when complete */ - private onPowerGet = () => { - return this._isActive; + private onPowerGet = ( + callback: (error: Error | null, value: boolean) => void + ) => { + return callback(null, this._isActive); }; private onBrightnessSet = async ( @@ -134,8 +138,10 @@ export class Chase implements IAccessory { return callback(); }; - private onBrightnessGet = () => { - return this._brightness; + private onBrightnessGet = ( + callback: (error: Error | null, value: number) => void + ) => { + return callback(null, this._brightness); }; /**