homebridge-lifx-plugin 0.1.3 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,30 @@
1
1
  # homebridge-lifx-plugin
2
2
 
3
- [![npm package](https://nodei.co/npm/homebridge-lifx-plugin.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/homebridge-lifx-plugin/)
3
+ > [![npm](https://img.shields.io/npm/dw/homebridge-lifx-plugin?logo=npm&style=flat-square)](https://www.npmjs.com/package/homebridge-lifx-plugin)
4
+ [![npm](https://img.shields.io/npm/v/homebridge-lifx-plugin?color=brightgreen&label=version&logo=npm&style=flat-square)](https://www.npmjs.com/package/homebridge-lifx-plugin)
5
+ [![GitHub last commit](https://img.shields.io/github/last-commit/calvarium/homebridge-lifx-plugin?logo=github&style=flat-square)](https://github.com/calvarium/homebridge-lifx-plugin)
4
6
 
5
7
  LIFX plugin for [Homebridge](https://github.com/homebridge/homebridge).
6
8
 
7
- This plugin automatically adds all Lifx smartbulbs available on the network to the homebridge
9
+ A plugin that adds lifx-lights in the network automatically to the homebridge, also single lights can be added manually.
10
+
11
+ This plugin will be updated regularly in the future, because I see it as a small heart task and use it personally.
12
+
13
+ The reason to create this plugin was the use of several published already existing lifx-plugins for homebridge. Unfortunately, all the plugins I tested slowed down homebridge so I couldn't access my devices from outside my network.
14
+ This plugin should fix that problem and add some extra functionality
15
+
16
+ I appreciate anyone who would like to use my plugin and welcome comments of any kind.
17
+
18
+ Of course, sometimes no error is left out, so forgive me if you might have problems and stay tuned. Updates will follow as soon as possible!
19
+
8
20
 
9
21
  ## Installation
10
22
 
11
23
  npm i homebridge-lifx-plugin
24
+
25
+ ## ToDo
26
+
27
+ - [x] Dim settings for brightness, color and On/Off
28
+ - [x] Add lights individually
29
+ - [ ] Separate dim settings for brightness, color and On/Off
30
+ - [ ] Configure lights individually
package/dist/bulb.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  export default class Bulb {
2
- static KELVIN_SCALE: number;
3
2
  static getStates(light: any, callback: any, errorFallback: any): void;
4
3
  static getHardwareInformation(light: any, callback: any, errorFallback: any): void;
5
4
  static getFirmwareVersion(light: any, callback: any, errorFallback: any): void;
6
5
  static update(light: any, state: any, duration: any): void;
7
- private static bulbWrapper;
8
6
  static getColorTemperatur(kelvin: any): number;
9
7
  static getKelvin(value: any): number;
10
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bulb.d.ts","sourceRoot":"","sources":["../src/bulb.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,MAAM,CAAC,YAAY,SAAuB;IAE1C,MAAM,CAAC,SAAS,CAAC,KAAK,KAAA,EAAE,QAAQ,KAAA,EAAE,aAAa,KAAA;IAU/C,MAAM,CAAC,sBAAsB,CAAC,KAAK,KAAA,EAAE,QAAQ,KAAA,EAAE,aAAa,KAAA;IAU5D,MAAM,CAAC,kBAAkB,CAAC,KAAK,KAAA,EAAE,QAAQ,KAAA,EAAE,aAAa,KAAA;IAUxD,MAAM,CAAC,MAAM,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA,EAAE,QAAQ,KAAA;IAIpC,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B,MAAM,CAAC,kBAAkB,CAAC,MAAM,KAAA;IAIhC,MAAM,CAAC,SAAS,CAAC,KAAK,KAAA;CAIvB"}
1
+ {"version":3,"file":"bulb.d.ts","sourceRoot":"","sources":["../src/bulb.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,MAAM,CAAC,SAAS,CAAC,KAAK,KAAA,EAAE,QAAQ,KAAA,EAAE,aAAa,KAAA;IAS/C,MAAM,CAAC,sBAAsB,CAAC,KAAK,KAAA,EAAE,QAAQ,KAAA,EAAE,aAAa,KAAA;IAS5D,MAAM,CAAC,kBAAkB,CAAC,KAAK,KAAA,EAAE,QAAQ,KAAA,EAAE,aAAa,KAAA;IASxD,MAAM,CAAC,MAAM,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA,EAAE,QAAQ,KAAA;IAIpC,MAAM,CAAC,kBAAkB,CAAC,MAAM,KAAA;IAIhC,MAAM,CAAC,SAAS,CAAC,KAAK,KAAA;CAIvB"}
package/dist/bulb.js CHANGED
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class Bulb {
4
4
  static getStates(light, callback, errorFallback) {
5
- // this.bulbWrapper(light.getState, callback, errorFallback);
6
5
  light.getState((err, value) => {
7
6
  if (err) {
8
7
  errorFallback(err);
@@ -11,7 +10,6 @@ class Bulb {
11
10
  });
12
11
  }
13
12
  static getHardwareInformation(light, callback, errorFallback) {
14
- // this.bulbWrapper(light.getHardwareVersion, callback, errorFallback);
15
13
  light.getHardwareVersion((err, value) => {
16
14
  if (err) {
17
15
  errorFallback(err);
@@ -20,7 +18,6 @@ class Bulb {
20
18
  });
21
19
  }
22
20
  static getFirmwareVersion(light, callback, errorFallback) {
23
- // this.bulbWrapper(light.getFirmwareVersion, callback, errorFallback);
24
21
  light.getFirmwareVersion((err, value) => {
25
22
  if (err) {
26
23
  errorFallback(err);
@@ -31,14 +28,6 @@ class Bulb {
31
28
  static update(light, state, duration) {
32
29
  light.color(state.color.hue, state.color.saturation, state.color.brightness, state.color.kelvin, duration);
33
30
  }
34
- static bulbWrapper(func, callback, errorFallback) {
35
- func((err, value) => {
36
- if (err) {
37
- errorFallback(err);
38
- }
39
- callback(value);
40
- });
41
- }
42
31
  static getColorTemperatur(kelvin) {
43
32
  return Math.round((640) / (10500 / kelvin));
44
33
  }
@@ -47,5 +36,4 @@ class Bulb {
47
36
  }
48
37
  }
49
38
  exports.default = Bulb;
50
- Bulb.KELVIN_SCALE = 0.05555555555555555;
51
39
  //# sourceMappingURL=bulb.js.map
package/dist/bulb.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bulb.js","sourceRoot":"","sources":["../src/bulb.ts"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tD,KAAK,CAAC,kBAAkB,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACtC,IAAI,GAAG,EAAE;gBACP,aAAa,CAAC,GAAG,CAAC,CAAC;aACpB;YACD,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ;QAClC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7G,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,MAAM;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,GAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,KAAK;QACpB,OAAO,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAC,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;CAEF;AAxCD,uBAwCC"}
@@ -1,4 +1,5 @@
1
1
  import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, Service, Characteristic } from 'homebridge';
2
+ import { LifxPlatformAccessory } from './platformAccessory';
2
3
  /**
3
4
  * HomebridgePlatform
4
5
  * This class is the main constructor for your plugin, this is where you should
@@ -11,24 +12,21 @@ export declare class LifxHomebridgePlatform implements DynamicPlatformPlugin {
11
12
  readonly Service: typeof Service;
12
13
  readonly Characteristic: typeof Characteristic;
13
14
  private lifxClient;
14
- readonly accessories: PlatformAccessory[];
15
+ private bulbs;
16
+ readonly cachedAccessories: PlatformAccessory[];
17
+ readonly accessories: LifxPlatformAccessory[];
15
18
  constructor(log: Logger, config: PlatformConfig, api: API);
16
19
  /**
17
20
  * This function is invoked when homebridge restores cached accessories from disk at startup.
18
21
  * It should be used to setup event handlers for characteristics and update respective values.
19
22
  */
20
23
  configureAccessory(accessory: PlatformAccessory): void;
21
- /**
22
- * This is an example method showing how to register discovered accessories.
23
- * Accessories must only be registered once, previously created accessories
24
- * must not be registered again to prevent "duplicate UUID" errors.
25
- */
26
24
  discoverDevices(): void;
27
- setLightCharacteristic(light: any, characteristic: any, value: any): void;
28
- setAccessoryCharacteristic(accessory: any, characteristic: any, value: any): void;
29
- getAccessory(light: any): PlatformAccessory<import("homebridge").UnknownContext> | undefined;
25
+ findAccessory(light: any): LifxPlatformAccessory | undefined;
30
26
  getUuid(light: any): string;
31
- findExistingAccessory(uuid: any): PlatformAccessory<import("homebridge").UnknownContext> | undefined;
32
- registerLight(light: any, name: any): void;
27
+ findCachedAccessory(light: any): PlatformAccessory<import("homebridge").UnknownContext> | undefined;
28
+ registerNewAccessory(light: any, name: any): PlatformAccessory<import("homebridge").UnknownContext>;
29
+ hookAccessory(accessory: any, light: any): void;
30
+ handleLight(light: any, name: any): void;
33
31
  }
34
32
  //# sourceMappingURL=platform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAO5H;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,qBAAqB;aAWhD,GAAG,EAAE,MAAM;aACX,MAAM,EAAE,cAAc;aACtB,GAAG,EAAE,GAAG;IAZ1B,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CAA+B;IAGpF,OAAO,CAAC,UAAU,CAA0B;IAG5C,SAAgB,WAAW,EAAE,iBAAiB,EAA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cf,aAAa,CAAC,KAAK,KAAA;IAInB,OAAO,CAAC,KAAK,KAAA;IAIb,mBAAmB,CAAC,KAAK,KAAA;IAIzB,oBAAoB,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA;IAMhC,aAAa,CAAC,SAAS,KAAA,EAAE,KAAK,KAAA;IAQ9B,WAAW,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA;CAkBxB"}
package/dist/platform.js CHANGED
@@ -14,7 +14,6 @@ const lifx_lan_client_1 = __importDefault(require("lifx-lan-client"));
14
14
  */
15
15
  class LifxHomebridgePlatform {
16
16
  constructor(log, config, api) {
17
- // Logger.setDebugEnabled(this.config.debug);
18
17
  this.log = log;
19
18
  this.config = config;
20
19
  this.api = api;
@@ -23,14 +22,18 @@ class LifxHomebridgePlatform {
23
22
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
23
  this.lifxClient = new lifx_lan_client_1.default.Client();
25
24
  // this is used to track restored cached accessories
25
+ this.cachedAccessories = [];
26
26
  this.accessories = [];
27
27
  this.log.debug('Finished initializing platform:', this.config.name);
28
+ if (this.config.bulbs) {
29
+ this.bulbs = this.config.bulbs.map(bulb => bulb.address);
30
+ }
28
31
  // When this event is fired it means Homebridge has restored all cached accessories from disk.
29
32
  // Dynamic Platform plugins should only register new accessories after this event was fired,
30
33
  // in order to ensure they weren't added to homebridge already. This event can also be used
31
34
  // to start discovery of new accessories.
32
35
  this.api.on('didFinishLaunching', () => {
33
- log.warn('Executed didFinishLaunching callback');
36
+ log.debug('Executed didFinishLaunching callback');
34
37
  // run the method to discover / register your devices as accessories
35
38
  this.discoverDevices();
36
39
  });
@@ -40,35 +43,41 @@ class LifxHomebridgePlatform {
40
43
  * It should be used to setup event handlers for characteristics and update respective values.
41
44
  */
42
45
  configureAccessory(accessory) {
43
- this.log.info('Loading accessory from cache:', accessory.displayName);
44
- this.setAccessoryCharacteristic(accessory, this.Characteristic.On, false);
46
+ this.log.debug('Loading accessory from cache:', accessory.displayName);
45
47
  // add the restored accessory to the accessories cache so we can track if it has already been registered
46
- this.accessories.push(accessory);
48
+ this.cachedAccessories.push(accessory);
47
49
  }
48
- /**
49
- * This is an example method showing how to register discovered accessories.
50
- * Accessories must only be registered once, previously created accessories
51
- * must not be registered again to prevent "duplicate UUID" errors.
52
- */
53
50
  discoverDevices() {
51
+ this.log.debug('Register eventhandlers');
54
52
  this.lifxClient.on('light-new', (light) => {
55
53
  light.getLabel((err, value) => {
56
- this.log.info('New light detected:', value);
54
+ this.log.debug('Light detected:', value);
57
55
  if (value) {
58
- this.registerLight(light, value);
56
+ this.handleLight(light, value);
59
57
  }
60
58
  });
61
59
  });
62
60
  this.lifxClient.on('light-online', (light) => {
63
- light.getLabel((err, value) => {
64
- this.log.info('Light online:', value);
65
- });
66
- this.setLightCharacteristic(light, this.Characteristic.On, true);
61
+ const accessory = this.findAccessory(light);
62
+ if (accessory) {
63
+ accessory.SetOnline();
64
+ this.log.debug('Light online', accessory.GetName());
65
+ }
66
+ else {
67
+ this.log.debug('Light online, but not found in list');
68
+ }
67
69
  });
68
70
  this.lifxClient.on('light-offline', (light) => {
69
- this.log.warn('Light offline', light.id);
70
- this.setLightCharacteristic(light, this.Characteristic.On, false);
71
+ const accessory = this.findAccessory(light);
72
+ if (accessory) {
73
+ accessory.SetOffline();
74
+ this.log.debug('Light offline', accessory.GetName());
75
+ }
76
+ else {
77
+ this.log.debug('Light offline, but not found in list');
78
+ }
71
79
  });
80
+ this.log.debug('Initialising lan client');
72
81
  this.lifxClient.init({
73
82
  broadcast: this.config.broadcast,
74
83
  lightOfflineTolerance: this.config.lightOfflineTolerance,
@@ -76,48 +85,45 @@ class LifxHomebridgePlatform {
76
85
  resendPacketDelay: this.config.resendPacketDelay,
77
86
  resendMaxTimes: this.config.resendMaxTimes,
78
87
  debug: this.config.debug,
88
+ lights: this.bulbs || [],
79
89
  });
80
90
  }
81
- setLightCharacteristic(light, characteristic, value) {
82
- this.setAccessoryCharacteristic(this.getAccessory(light), characteristic, value);
83
- }
84
- setAccessoryCharacteristic(accessory, characteristic, value) {
85
- if (accessory) {
86
- // the accessory already exists
87
- accessory.getService(this.Service.Lightbulb)
88
- .updateCharacteristic(characteristic, value);
89
- }
90
- }
91
- getAccessory(light) {
92
- return this.findExistingAccessory(this.getUuid(light));
91
+ findAccessory(light) {
92
+ return this.accessories.find(accessory => accessory.UUID === this.getUuid(light));
93
93
  }
94
94
  getUuid(light) {
95
95
  return this.api.hap.uuid.generate(light.id);
96
96
  }
97
- findExistingAccessory(uuid) {
98
- return this.accessories.find(accessory => accessory.UUID === uuid);
97
+ findCachedAccessory(light) {
98
+ return this.cachedAccessories.find(accessory => accessory.UUID === this.getUuid(light));
99
99
  }
100
- registerLight(light, name) {
101
- const uuid = this.getUuid(light);
100
+ registerNewAccessory(light, name) {
101
+ const accessory = new this.api.platformAccessory(name, this.getUuid(light));
102
+ this.api.registerPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [accessory]);
103
+ return accessory;
104
+ }
105
+ hookAccessory(accessory, light) {
106
+ this.accessories.push(new platformAccessory_1.LifxPlatformAccessory(this, accessory, light, {
107
+ Duration: this.config.duration,
108
+ BrightnessDuration: this.config.brightnessDuration,
109
+ ColorDuration: this.config.colorDuration,
110
+ }));
111
+ }
112
+ handleLight(light, name) {
102
113
  // see if an accessory with the same uuid has already been registered and restored from
103
114
  // the cached devices we stored in the `configureAccessory` method above
104
- let accessory = this.findExistingAccessory(uuid);
115
+ let accessory = this.findCachedAccessory(light);
105
116
  if (accessory) {
106
117
  // the accessory already exists
107
- this.log.info('Restoring existing accessory from cache:', name);
118
+ this.log.debug('Restoring existing accessory from cache:', name);
108
119
  }
109
120
  else {
110
121
  // the accessory does not yet exist, so we need to create it
111
- this.log.info('Adding new accessory:', name);
112
- // create a new accessory
113
- accessory = new this.api.platformAccessory(name, uuid);
114
- this.api.registerPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [accessory]);
122
+ this.log.debug('Adding new accessory:', name);
123
+ accessory = this.registerNewAccessory(light, name);
115
124
  }
116
- new platformAccessory_1.LifxPlatformAccessory(this, accessory, light, {
117
- Duration: this.config.duration,
118
- BrightnessDuration: this.config.brightnessDuration,
119
- ColorDuration: this.config.colorDuration,
120
- });
125
+ this.log.debug('Hooking light to accessory', name);
126
+ this.hookAccessory(accessory, light);
121
127
  }
122
128
  }
123
129
  exports.LifxHomebridgePlatform = LifxHomebridgePlatform;
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAwD;AACxD,2DAA4D;AAE5D,sEAAmC;AAEnC;;;;GAIG;AACH,MAAa,sBAAsB;IAUjC,YACkB,GAAW,EACX,MAAsB,EACtB,GAAQ;QAGxB,6CAA6C;QAL7B,QAAG,GAAH,GAAG,CAAQ;QACX,WAAM,GAAN,MAAM,CAAgB;QACtB,QAAG,GAAH,GAAG,CAAK;QAZV,YAAO,GAAmB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;QAC/C,mBAAc,GAA0B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QAEpF,8DAA8D;QACtD,eAAU,GAAQ,IAAI,yBAAI,CAAC,MAAM,EAAE,CAAC;QAE5C,oDAAoD;QACpC,gBAAW,GAAwB,EAAE,CAAC;QAUpD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAGpE,8FAA8F;QAC9F,4FAA4F;QAC5F,2FAA2F;QAC3F,yCAAyC;QACzC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;YACrC,GAAG,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACjD,oEAAoE;YACpE,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OA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IAAI,yCAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE;YACtE,QAAQ,EAAG,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC/B,kBAAkB,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB;YAClD,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;SACzC,CAAC,CAAC,CAAC;IACN,CAAC;IAED,WAAW,CAAC,KAAK,EAAE,IAAI;QACrB,uFAAuF;QACvF,wEAAwE;QACxE,IAAI,SAAS,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAEhD,IAAI,SAAS,EAAE;YACb,+BAA+B;YAC/B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,0CAA0C,EAAE,IAAI,CAAC,CAAC;SAElE;aAAM;YACL,4DAA4D;YAC5D,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;YAC9C,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;SACpD;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;CAEF;AAvID,wDAuIC"}
@@ -7,11 +7,12 @@ import { LifxHomebridgePlatform } from './platform';
7
7
  */
8
8
  export declare class LifxPlatformAccessory {
9
9
  private readonly platform;
10
- private readonly accessory;
10
+ readonly Accessory: PlatformAccessory;
11
11
  private readonly light;
12
12
  private service;
13
13
  private informationService;
14
- private pollRequests;
14
+ private online;
15
+ private watcher;
15
16
  /**
16
17
  * These are just used to create a working example
17
18
  * You should implement your own code to track the state of your accessory
@@ -20,7 +21,8 @@ export declare class LifxPlatformAccessory {
20
21
  private Settings;
21
22
  private HardwareInfo;
22
23
  private FirmwareVersion;
23
- constructor(platform: LifxHomebridgePlatform, accessory: PlatformAccessory, light: any, settings: any);
24
+ UUID: string;
25
+ constructor(platform: LifxHomebridgePlatform, Accessory: PlatformAccessory, light: any, settings: any);
24
26
  /**
25
27
  * Handle the "GET" requests from HomeKit
26
28
  * These are sent when HomeKit wants to know the current state of the accessory, for example, checking if a Light bulb is on.
@@ -41,11 +43,11 @@ export declare class LifxPlatformAccessory {
41
43
  setSaturation(value: CharacteristicValue): Promise<void>;
42
44
  setKelvin(value: CharacteristicValue): Promise<void>;
43
45
  handleError(err: any): void;
44
- watchState(callback: any): Promise<void>;
45
- setStates(state: any): Promise<void>;
46
+ watchState(): Promise<void>;
47
+ resetWatcher(): Promise<void>;
46
48
  updateStates(callback: any): Promise<void>;
47
- setLightbuldCharacteristics(state: any): Promise<void>;
48
- updateLightbuldCharacteristics(state: any): Promise<void>;
49
+ setStates(state: any): Promise<void>;
50
+ updateLightbuldCharacteristics(): Promise<void>;
49
51
  setHardwareInformation(callback: any): Promise<void>;
50
52
  setAccessoryInformationCharacteristics(info: any): Promise<void>;
51
53
  setFirmwareVersion(): Promise<void>;
@@ -53,5 +55,14 @@ export declare class LifxPlatformAccessory {
53
55
  setAccessoryInformationCharacteristic(characteristic: any, value: CharacteristicValue): Promise<void>;
54
56
  setLightbulbCharacteristic(characteristic: any, value: CharacteristicValue): Promise<void>;
55
57
  updateLightbulbCharacteristic(characteristic: any, value: CharacteristicValue): Promise<void>;
58
+ updateOn(): void;
59
+ updateHue(): void;
60
+ updateSaturation(): void;
61
+ updateBrightness(): void;
62
+ updateKelvin(): void;
63
+ setPower(value: any): void;
64
+ SetOnline(): Promise<void>;
65
+ SetOffline(): Promise<void>;
66
+ GetName(): string;
56
67
  }
57
68
  //# sourceMappingURL=platformAccessory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platformAccessory.d.ts","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7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IAQ/B,sCAAsC,CAAC,IAAI,KAAA;IAM3C,kBAAkB;IAOlB,mBAAmB,CAAC,OAAO,KAAA;IAI3B,qCAAqC,CAAC,cAAc,KAAA,EAAE,KAAK,EAAG,mBAAmB;IAIjF,0BAA0B,CAAC,cAAc,KAAA,EAAE,KAAK,EAAG,mBAAmB;IAItE,6BAA6B,CAAC,cAAc,KAAA,EAAE,KAAK,EAAG,mBAAmB;IAI/E,QAAQ;IAIR,SAAS;IAIT,gBAAgB;IAIhB,gBAAgB;IAIhB,YAAY;IAIZ,QAAQ,CAAC,KAAK,KAAA;IAKD,SAAS;IAKT,UAAU;IAKhB,OAAO;CAIf"}
@@ -11,12 +11,11 @@ const bulb_1 = __importDefault(require("./bulb"));
11
11
  * Each accessory may expose multiple services of different service types.
12
12
  */
13
13
  class LifxPlatformAccessory {
14
- constructor(platform, accessory, light, settings) {
14
+ constructor(platform, Accessory, light, settings) {
15
15
  this.platform = platform;
16
- this.accessory = accessory;
16
+ this.Accessory = Accessory;
17
17
  this.light = light;
18
- //Count of requests for watcher
19
- this.pollRequests = 0;
18
+ this.online = false;
20
19
  /**
21
20
  * These are just used to create a working example
22
21
  * You should implement your own code to track the state of your accessory
@@ -40,11 +39,13 @@ class LifxPlatformAccessory {
40
39
  majorVersion: 0,
41
40
  minorVersion: 1,
42
41
  };
42
+ this.UUID = Accessory.UUID;
43
43
  this.Settings = settings;
44
+ this.online = true;
44
45
  // get the LightBulb service if it exists, otherwise create a new LightBulb service
45
46
  // you can create multiple services for each accessory
46
- this.service = this.accessory.getService(this.platform.Service.Lightbulb) || this.accessory.addService(this.platform.Service.Lightbulb);
47
- this.informationService = this.accessory.getService(this.platform.Service.AccessoryInformation);
47
+ this.service = this.Accessory.getService(this.platform.Service.Lightbulb) || this.Accessory.addService(this.platform.Service.Lightbulb);
48
+ this.informationService = this.Accessory.getService(this.platform.Service.AccessoryInformation);
48
49
  // set accessory information
49
50
  this.setFirmwareVersion();
50
51
  this.setHardwareInformation(() => {
@@ -70,7 +71,7 @@ class LifxPlatformAccessory {
70
71
  this.service.getCharacteristic(this.platform.Characteristic.Saturation)
71
72
  .onSet(this.setSaturation.bind(this)); // SET - bind to the 'setBrightness` method below
72
73
  }
73
- // this.watchState((state) => this.setStates(state));
74
+ this.resetWatcher();
74
75
  });
75
76
  });
76
77
  }
@@ -93,82 +94,117 @@ class LifxPlatformAccessory {
93
94
  return isOn;
94
95
  }
95
96
  async setOn(value) {
96
- this.States.power = value;
97
- if (this.States.power > 0) {
98
- this.light.on(this.Settings.Duration);
97
+ this.resetWatcher();
98
+ if (!this.online) {
99
+ this.updateLightbuldCharacteristics();
100
+ //place Timeout right here
99
101
  }
100
102
  else {
101
- this.light.off(this.Settings.Duration);
103
+ this.States.power = value;
104
+ if (this.States.power > 0) {
105
+ this.light.on(this.Settings.Duration);
106
+ }
107
+ else {
108
+ this.light.off(this.Settings.Duration);
109
+ }
110
+ this.platform.log.debug('Set Characteristic On ->', value);
102
111
  }
103
- this.platform.log.debug('Set Characteristic On ->', value);
104
112
  }
105
113
  async setBrightness(value) {
106
- this.States.color.brightness = value;
107
- bulb_1.default.update(this.light, this.States, this.Settings.BrightnessDuration);
108
- this.platform.log.debug('Set Characteristic Brightness -> ', value);
114
+ this.resetWatcher();
115
+ if (!this.online) {
116
+ this.updateLightbuldCharacteristics();
117
+ //place Timeout right here
118
+ }
119
+ else {
120
+ this.States.color.brightness = value;
121
+ bulb_1.default.update(this.light, this.States, this.Settings.BrightnessDuration);
122
+ // this.updateLightbuldCharacteristics();
123
+ this.platform.log.debug('Set Characteristic Brightness -> ', value);
124
+ }
109
125
  }
110
126
  async setHue(value) {
111
- this.States.color.hue = value;
112
- bulb_1.default.update(this.light, this.States, this.Settings.ColorDuration);
113
- this.platform.log.debug('Set Characteristic Hue -> ', value);
127
+ this.resetWatcher();
128
+ if (!this.online) {
129
+ this.updateLightbuldCharacteristics();
130
+ //place Timeout right here
131
+ }
132
+ else {
133
+ this.States.color.hue = value;
134
+ bulb_1.default.update(this.light, this.States, this.Settings.ColorDuration);
135
+ // this.updateLightbuldCharacteristics();
136
+ this.platform.log.debug('Set Characteristic Hue -> ', value);
137
+ }
114
138
  }
115
139
  async setSaturation(value) {
116
- this.States.color.saturation = value;
117
- bulb_1.default.update(this.light, this.States, this.Settings.ColorDuration);
118
- this.platform.log.debug('Set Characteristic Saturation -> ', value);
140
+ this.resetWatcher();
141
+ if (!this.online) {
142
+ this.updateLightbuldCharacteristics();
143
+ //place Timeout right here
144
+ }
145
+ else {
146
+ this.States.color.saturation = value;
147
+ bulb_1.default.update(this.light, this.States, this.Settings.ColorDuration);
148
+ // this.updateLightbuldCharacteristics();
149
+ this.platform.log.debug('Set Characteristic Saturation -> ', value);
150
+ }
119
151
  }
120
152
  async setKelvin(value) {
121
- this.States.color.hue = 0;
122
- this.States.color.saturation = 0;
123
- this.States.color.kelvin = bulb_1.default.getKelvin(value);
124
- this.updateLightbuldCharacteristics(this.States);
125
- bulb_1.default.update(this.light, this.States, this.Settings.ColorDuration);
126
- this.platform.log.debug('Set Characteristic Kelvin -> ', value);
153
+ this.resetWatcher();
154
+ if (!this.online) {
155
+ this.updateLightbuldCharacteristics();
156
+ //place Timeout right here
157
+ }
158
+ else {
159
+ this.States.color.hue = 0;
160
+ this.States.color.saturation = 0;
161
+ this.States.color.kelvin = bulb_1.default.getKelvin(value);
162
+ // this.updateLightbuldCharacteristics();
163
+ bulb_1.default.update(this.light, this.States, this.Settings.ColorDuration);
164
+ this.platform.log.debug('Set Characteristic Kelvin -> ', value);
165
+ }
127
166
  }
128
167
  handleError(err) {
129
- this.platform.log.error(err);
168
+ this.platform.log.debug('Bulb throughs error', err);
169
+ this.SetOffline();
130
170
  // if you need to return an error to show the device as "Not Responding" in the Home app:
131
171
  // throw new this.platform.api.hap.HapStatusError(this.platform.api.hap.HAPStatus.SERVICE_COMMUNICATION_FAILURE);
132
172
  }
133
- async watchState(callback) {
134
- setInterval(() => {
135
- bulb_1.default.getStates(this.light, (state) => {
136
- if (this.States !== state) {
137
- this.pollRequests++;
138
- if (this.pollRequests >= 3) {
139
- callback(state);
140
- this.pollRequests = 0;
141
- }
142
- }
143
- else {
144
- this.pollRequests = 0;
145
- }
146
- }, (err) => this.handleError(err));
147
- }, 3000);
173
+ async watchState() {
174
+ this.watcher = setInterval(() => {
175
+ this.updateStates(() => {
176
+ this.platform.log.debug('updated', this.States);
177
+ });
178
+ }, 5000);
148
179
  }
149
- async setStates(state) {
150
- this.States = state;
151
- this.setLightbuldCharacteristics(this.States);
180
+ async resetWatcher() {
181
+ if (this.watcher) {
182
+ clearInterval(this.watcher);
183
+ }
184
+ this.watchState();
152
185
  }
153
186
  async updateStates(callback) {
154
187
  bulb_1.default.getStates(this.light, (state) => {
155
- this.setStates(state);
156
- callback();
188
+ if (state !== null) {
189
+ this.SetOnline();
190
+ this.setStates(state);
191
+ callback();
192
+ }
193
+ else {
194
+ this.SetOffline();
195
+ }
157
196
  }, (err) => this.handleError(err));
158
197
  }
159
- async setLightbuldCharacteristics(state) {
160
- this.setLightbulbCharacteristic(this.platform.Characteristic.On, state.power);
161
- this.setLightbulbCharacteristic(this.platform.Characteristic.Hue, state.color.hue);
162
- this.setLightbulbCharacteristic(this.platform.Characteristic.Saturation, state.color.saturation);
163
- this.setLightbulbCharacteristic(this.platform.Characteristic.Brightness, state.color.brightness);
164
- this.setLightbulbCharacteristic(this.platform.Characteristic.ColorTemperature, bulb_1.default.getColorTemperatur(state.color.kelvin));
198
+ async setStates(state) {
199
+ this.States = state;
200
+ this.updateLightbuldCharacteristics();
165
201
  }
166
- async updateLightbuldCharacteristics(state) {
167
- this.updateLightbulbCharacteristic(this.platform.Characteristic.On, state.power);
168
- this.updateLightbulbCharacteristic(this.platform.Characteristic.Hue, state.color.hue);
169
- this.updateLightbulbCharacteristic(this.platform.Characteristic.Saturation, state.color.saturation);
170
- this.updateLightbulbCharacteristic(this.platform.Characteristic.Brightness, state.color.brightness);
171
- this.updateLightbulbCharacteristic(this.platform.Characteristic.ColorTemperature, bulb_1.default.getColorTemperatur(state.color.kelvin));
202
+ async updateLightbuldCharacteristics() {
203
+ this.updateOn();
204
+ this.updateHue();
205
+ this.updateSaturation();
206
+ this.updateBrightness();
207
+ this.updateKelvin();
172
208
  }
173
209
  async setHardwareInformation(callback) {
174
210
  bulb_1.default.getHardwareInformation(this.light, (info) => {
@@ -200,6 +236,36 @@ class LifxPlatformAccessory {
200
236
  async updateLightbulbCharacteristic(characteristic, value) {
201
237
  this.service.updateCharacteristic(characteristic, value);
202
238
  }
239
+ updateOn() {
240
+ this.updateLightbulbCharacteristic(this.platform.Characteristic.On, this.States.power);
241
+ }
242
+ updateHue() {
243
+ this.updateLightbulbCharacteristic(this.platform.Characteristic.Hue, this.States.color.hue);
244
+ }
245
+ updateSaturation() {
246
+ this.updateLightbulbCharacteristic(this.platform.Characteristic.Saturation, this.States.color.saturation);
247
+ }
248
+ updateBrightness() {
249
+ this.updateLightbulbCharacteristic(this.platform.Characteristic.Brightness, this.States.color.brightness);
250
+ }
251
+ updateKelvin() {
252
+ this.updateLightbulbCharacteristic(this.platform.Characteristic.ColorTemperature, bulb_1.default.getColorTemperatur(this.States.color.kelvin));
253
+ }
254
+ setPower(value) {
255
+ this.States.power = value;
256
+ this.updateOn();
257
+ }
258
+ async SetOnline() {
259
+ this.online = true;
260
+ this.setPower(1);
261
+ }
262
+ async SetOffline() {
263
+ this.online = false;
264
+ this.setPower(0);
265
+ }
266
+ GetName() {
267
+ return this.States.label;
268
+ }
203
269
  }
204
270
  exports.LifxPlatformAccessory = LifxPlatformAccessory;
205
271
  //# sourceMappingURL=platformAccessory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platformAccessory.js","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":";;;;;;AAIA,kDAA0B;AAE1B;;;;GAIG;AAEH,MAAa,qBAAqB;IAiChC,YACmB,QAAgC,EAChC,SAA4B,EAC5B,KAAK,EACtB,QAAQ;QAHS,aAAQ,GAAR,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cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5G,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5G,CAAC;IAED,YAAY;QACV,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,gBAAgB,EAAE,cAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACvI,CAAC;IAED,QAAQ,CAAC,KAAK;QACZ,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,SAAS;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,UAAU;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3B,CAAC;CAEF;AArTD,sDAqTC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "displayName": "Lifx Plugin",
4
4
  "name": "homebridge-lifx-plugin",
5
- "version": "0.1.3",
5
+ "version": "0.1.7",
6
6
  "description": "This plugin is a bridge between lifx smart bulbs and your apple homekit",
7
7
  "license": "Apache-2.0",
8
8
  "repository": {
@@ -24,7 +24,14 @@
24
24
  "prepublishOnly": "npm run lint && npm run build"
25
25
  },
26
26
  "keywords": [
27
- "homebridge-plugin"
27
+ "homebridge-plugin",
28
+ "homebridge",
29
+ "plugin",
30
+ "lifx",
31
+ "bulb",
32
+ "smartbulb",
33
+ "smartlight",
34
+ "homekit"
28
35
  ],
29
36
  "dependencies": {
30
37
  "lifx-lan-client": "^1.1.0"