Fixing issue where flux was unresponsive
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/tag Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/tag Build is passing
				
			This commit is contained in:
		
							
								
								
									
										9
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							@@ -8,9 +8,12 @@
 | 
			
		||||
      "type": "node",
 | 
			
		||||
      "request": "launch",
 | 
			
		||||
      "name": "Launch Program",
 | 
			
		||||
            "preLaunchTask": "build and install",
 | 
			
		||||
            "program": "/Users/brandonwatson/.npm-global/bin/homebridge",
 | 
			
		||||
            "sourceMaps": true,
 | 
			
		||||
      "preLaunchTask": "build",
 | 
			
		||||
      "program": "/Users/brandonwatson/.nvm/versions/node/v14.15.0/lib/node_modules/homebridge/bin/homebridge",
 | 
			
		||||
      "env": {
 | 
			
		||||
        "HOMEBRIDGE_OPTS": "/Users/brandonwatson/.homebridge"
 | 
			
		||||
      },
 | 
			
		||||
      "sourceMaps": true
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							@@ -6,6 +6,7 @@
 | 
			
		||||
    {
 | 
			
		||||
      "type": "npm",
 | 
			
		||||
      "script": "build",
 | 
			
		||||
      "label": "build",
 | 
			
		||||
      "problemMatcher": []
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@watsonb8/homebridge-flux",
 | 
			
		||||
    "version": "1.1.1",
 | 
			
		||||
    "version": "1.1.2",
 | 
			
		||||
    "lockfileVersion": 1,
 | 
			
		||||
    "requires": true,
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@watsonb8/homebridge-flux",
 | 
			
		||||
    "version": "1.1.1",
 | 
			
		||||
    "version": "1.1.2",
 | 
			
		||||
    "description": "",
 | 
			
		||||
    "main": "bin/index.js",
 | 
			
		||||
    "publishConfig": {
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user