Fixing issue where flux was unresponsive
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Brandon Watson
2022-01-03 13:13:50 -05:00
parent 8825a116fe
commit 55c65dac84
5 changed files with 44 additions and 37 deletions

View File

@ -8,7 +8,6 @@ import { IConfig } from "./models/iConfig";
import { GetTimesResult, getTimes } from "suncalc";
import HueError = require("node-hue-api/lib/HueError");
import cron from "node-cron";
import { callbackify } from "util";
let Service: HAPNodeJS.Service;
let Characteristic: HAPNodeJS.Characteristic;
@ -102,6 +101,7 @@ export class FluxAccessory implements IAccessory {
.getCharacteristic(Characteristic.On)
//@ts-ignore
.on("set", this.onSetEnabled)
//@ts-ignore
.on("get", this.onGetEnabled);
}
@ -134,9 +134,12 @@ export class FluxAccessory implements IAccessory {
* Handler for switch get event
* @param callback The callback function to call when complete
*/
private onGetEnabled = (): boolean => {
return this._isActive;
};
private onGetEnabled(
callback: (error: Error | null, value: boolean) => void
): void {
callback(null, this._isActive);
// return this._isActive;
}
/**
* Called by homebridge to gather services.