homebridge-lifx-plugin 0.1.3 → 0.1.4
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/dist/bulb.d.ts +0 -2
- package/dist/bulb.d.ts.map +1 -1
- package/dist/bulb.js +0 -12
- package/dist/bulb.js.map +1 -1
- package/dist/platform.d.ts +9 -11
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +51 -45
- package/dist/platform.js.map +1 -1
- package/dist/platformAccessory.d.ts +14 -5
- package/dist/platformAccessory.d.ts.map +1 -1
- package/dist/platformAccessory.js +44 -21
- package/dist/platformAccessory.js.map +1 -1
- package/package.json +1 -1
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
|
}
|
package/dist/bulb.d.ts.map
CHANGED
|
@@ -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,
|
|
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"],"names":[],"mappings":";;AAAA,MAAqB,IAAI;
|
|
1
|
+
{"version":3,"file":"bulb.js","sourceRoot":"","sources":["../src/bulb.ts"],"names":[],"mappings":";;AAAA,MAAqB,IAAI;IACvB,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,aAAa;QAC7C,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YAC5B,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,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,aAAa;QAC1D,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,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,aAAa;QACtD,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"}
|
package/dist/platform.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
32
|
-
|
|
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
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -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;
|
|
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;AAG5H,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAI5D;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,qBAAqB;aAYhD,GAAG,EAAE,MAAM;aACX,MAAM,EAAE,cAAc;aACtB,GAAG,EAAE,GAAG;IAb1B,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CAA+B;IAGpF,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,KAAK,CAAC;IAEd,SAAgB,iBAAiB,EAAE,iBAAiB,EAAE,CAAM;IAC5D,SAAgB,WAAW,EAAE,qBAAqB,EAAE,CAAM;gBAGxC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG;IAoB1B;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAQ/C,eAAe;IA6Cf,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.
|
|
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.
|
|
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.
|
|
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.
|
|
54
|
+
this.log.debug('Light detected:', value);
|
|
57
55
|
if (value) {
|
|
58
|
-
this.
|
|
56
|
+
this.handleLight(light, value);
|
|
59
57
|
}
|
|
60
58
|
});
|
|
61
59
|
});
|
|
62
60
|
this.lifxClient.on('light-online', (light) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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.
|
|
70
|
-
|
|
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
|
-
|
|
82
|
-
this.
|
|
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
|
-
|
|
98
|
-
return this.
|
|
97
|
+
findCachedAccessory(light) {
|
|
98
|
+
return this.cachedAccessories.find(accessory => accessory.UUID === this.getUuid(light));
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
const
|
|
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.
|
|
115
|
+
let accessory = this.findCachedAccessory(light);
|
|
105
116
|
if (accessory) {
|
|
106
117
|
// the accessory already exists
|
|
107
|
-
this.log.
|
|
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.
|
|
112
|
-
|
|
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
|
-
|
|
117
|
-
|
|
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;
|
package/dist/platform.js.map
CHANGED
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAwD;AACxD,2DAA4D;AAE5D,sEAAmC;AAEnC;;;;GAIG;AACH,MAAa,sBAAsB;IAWjC,YACkB,GAAW,EACX,MAAsB,EACtB,GAAQ;QAFR,QAAG,GAAH,GAAG,CAAQ;QACX,WAAM,GAAN,MAAM,CAAgB;QACtB,QAAG,GAAH,GAAG,CAAK;QAbV,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,sBAAiB,GAAwB,EAAE,CAAC;QAC5C,gBAAW,GAA4B,EAAE,CAAC;QAQxD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,IAAI,CAAC,MAAM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EhD,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,7 +7,7 @@ import { LifxHomebridgePlatform } from './platform';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class LifxPlatformAccessory {
|
|
9
9
|
private readonly platform;
|
|
10
|
-
|
|
10
|
+
readonly Accessory: PlatformAccessory;
|
|
11
11
|
private readonly light;
|
|
12
12
|
private service;
|
|
13
13
|
private informationService;
|
|
@@ -20,7 +20,8 @@ export declare class LifxPlatformAccessory {
|
|
|
20
20
|
private Settings;
|
|
21
21
|
private HardwareInfo;
|
|
22
22
|
private FirmwareVersion;
|
|
23
|
-
|
|
23
|
+
UUID: string;
|
|
24
|
+
constructor(platform: LifxHomebridgePlatform, Accessory: PlatformAccessory, light: any, settings: any);
|
|
24
25
|
/**
|
|
25
26
|
* Handle the "GET" requests from HomeKit
|
|
26
27
|
* These are sent when HomeKit wants to know the current state of the accessory, for example, checking if a Light bulb is on.
|
|
@@ -42,10 +43,9 @@ export declare class LifxPlatformAccessory {
|
|
|
42
43
|
setKelvin(value: CharacteristicValue): Promise<void>;
|
|
43
44
|
handleError(err: any): void;
|
|
44
45
|
watchState(callback: any): Promise<void>;
|
|
45
|
-
setStates(state: any): Promise<void>;
|
|
46
46
|
updateStates(callback: any): Promise<void>;
|
|
47
|
-
|
|
48
|
-
updateLightbuldCharacteristics(
|
|
47
|
+
setStates(state: any): Promise<void>;
|
|
48
|
+
updateLightbuldCharacteristics(): Promise<void>;
|
|
49
49
|
setHardwareInformation(callback: any): Promise<void>;
|
|
50
50
|
setAccessoryInformationCharacteristics(info: any): Promise<void>;
|
|
51
51
|
setFirmwareVersion(): Promise<void>;
|
|
@@ -53,5 +53,14 @@ export declare class LifxPlatformAccessory {
|
|
|
53
53
|
setAccessoryInformationCharacteristic(characteristic: any, value: CharacteristicValue): Promise<void>;
|
|
54
54
|
setLightbulbCharacteristic(characteristic: any, value: CharacteristicValue): Promise<void>;
|
|
55
55
|
updateLightbulbCharacteristic(characteristic: any, value: CharacteristicValue): Promise<void>;
|
|
56
|
+
updateOn(): void;
|
|
57
|
+
updateHue(): void;
|
|
58
|
+
updateSaturation(): void;
|
|
59
|
+
updateBrightness(): void;
|
|
60
|
+
updateKelvin(): void;
|
|
61
|
+
setPower(value: any): void;
|
|
62
|
+
SetOnline(): Promise<void>;
|
|
63
|
+
SetOffline(): Promise<void>;
|
|
64
|
+
GetName(): string;
|
|
56
65
|
}
|
|
57
66
|
//# 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;AAE7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIpD;;;;GAIG;AAEH,qBAAa,qBAAqB;
|
|
1
|
+
{"version":3,"file":"platformAccessory.d.ts","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIpD;;;;GAIG;AAEH,qBAAa,qBA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IAIhB,YAAY;IAIZ,QAAQ,CAAC,KAAK,KAAA;IAKD,SAAS;IAIT,UAAU;IAIhB,OAAO;CAIf"}
|
|
@@ -11,9 +11,9 @@ 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,
|
|
14
|
+
constructor(platform, Accessory, light, settings) {
|
|
15
15
|
this.platform = platform;
|
|
16
|
-
this.
|
|
16
|
+
this.Accessory = Accessory;
|
|
17
17
|
this.light = light;
|
|
18
18
|
//Count of requests for watcher
|
|
19
19
|
this.pollRequests = 0;
|
|
@@ -40,11 +40,12 @@ class LifxPlatformAccessory {
|
|
|
40
40
|
majorVersion: 0,
|
|
41
41
|
minorVersion: 1,
|
|
42
42
|
};
|
|
43
|
+
this.UUID = Accessory.UUID;
|
|
43
44
|
this.Settings = settings;
|
|
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.
|
|
47
|
-
this.informationService = this.
|
|
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(() => {
|
|
@@ -121,7 +122,7 @@ class LifxPlatformAccessory {
|
|
|
121
122
|
this.States.color.hue = 0;
|
|
122
123
|
this.States.color.saturation = 0;
|
|
123
124
|
this.States.color.kelvin = bulb_1.default.getKelvin(value);
|
|
124
|
-
this.updateLightbuldCharacteristics(
|
|
125
|
+
this.updateLightbuldCharacteristics();
|
|
125
126
|
bulb_1.default.update(this.light, this.States, this.Settings.ColorDuration);
|
|
126
127
|
this.platform.log.debug('Set Characteristic Kelvin -> ', value);
|
|
127
128
|
}
|
|
@@ -136,6 +137,7 @@ class LifxPlatformAccessory {
|
|
|
136
137
|
if (this.States !== state) {
|
|
137
138
|
this.pollRequests++;
|
|
138
139
|
if (this.pollRequests >= 3) {
|
|
140
|
+
this.platform.log.debug('Changes discovered on the light', this.States, state);
|
|
139
141
|
callback(state);
|
|
140
142
|
this.pollRequests = 0;
|
|
141
143
|
}
|
|
@@ -146,29 +148,22 @@ class LifxPlatformAccessory {
|
|
|
146
148
|
}, (err) => this.handleError(err));
|
|
147
149
|
}, 3000);
|
|
148
150
|
}
|
|
149
|
-
async setStates(state) {
|
|
150
|
-
this.States = state;
|
|
151
|
-
this.setLightbuldCharacteristics(this.States);
|
|
152
|
-
}
|
|
153
151
|
async updateStates(callback) {
|
|
154
152
|
bulb_1.default.getStates(this.light, (state) => {
|
|
155
153
|
this.setStates(state);
|
|
156
154
|
callback();
|
|
157
155
|
}, (err) => this.handleError(err));
|
|
158
156
|
}
|
|
159
|
-
async
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
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));
|
|
157
|
+
async setStates(state) {
|
|
158
|
+
this.States = state;
|
|
159
|
+
this.updateLightbuldCharacteristics();
|
|
165
160
|
}
|
|
166
|
-
async updateLightbuldCharacteristics(
|
|
167
|
-
this.
|
|
168
|
-
this.
|
|
169
|
-
this.
|
|
170
|
-
this.
|
|
171
|
-
this.
|
|
161
|
+
async updateLightbuldCharacteristics() {
|
|
162
|
+
this.updateOn();
|
|
163
|
+
this.updateHue();
|
|
164
|
+
this.updateSaturation();
|
|
165
|
+
this.updateBrightness();
|
|
166
|
+
this.updateKelvin();
|
|
172
167
|
}
|
|
173
168
|
async setHardwareInformation(callback) {
|
|
174
169
|
bulb_1.default.getHardwareInformation(this.light, (info) => {
|
|
@@ -200,6 +195,34 @@ class LifxPlatformAccessory {
|
|
|
200
195
|
async updateLightbulbCharacteristic(characteristic, value) {
|
|
201
196
|
this.service.updateCharacteristic(characteristic, value);
|
|
202
197
|
}
|
|
198
|
+
updateOn() {
|
|
199
|
+
this.updateLightbulbCharacteristic(this.platform.Characteristic.On, this.States.power);
|
|
200
|
+
}
|
|
201
|
+
updateHue() {
|
|
202
|
+
this.updateLightbulbCharacteristic(this.platform.Characteristic.Hue, this.States.color.hue);
|
|
203
|
+
}
|
|
204
|
+
updateSaturation() {
|
|
205
|
+
this.updateLightbulbCharacteristic(this.platform.Characteristic.Saturation, this.States.color.saturation);
|
|
206
|
+
}
|
|
207
|
+
updateBrightness() {
|
|
208
|
+
this.updateLightbulbCharacteristic(this.platform.Characteristic.Brightness, this.States.color.brightness);
|
|
209
|
+
}
|
|
210
|
+
updateKelvin() {
|
|
211
|
+
this.updateLightbulbCharacteristic(this.platform.Characteristic.ColorTemperature, bulb_1.default.getColorTemperatur(this.States.color.kelvin));
|
|
212
|
+
}
|
|
213
|
+
setPower(value) {
|
|
214
|
+
this.States.power = value;
|
|
215
|
+
this.updateOn();
|
|
216
|
+
}
|
|
217
|
+
async SetOnline() {
|
|
218
|
+
this.setPower(1);
|
|
219
|
+
}
|
|
220
|
+
async SetOffline() {
|
|
221
|
+
this.setPower(0);
|
|
222
|
+
}
|
|
223
|
+
GetName() {
|
|
224
|
+
return this.States.label;
|
|
225
|
+
}
|
|
203
226
|
}
|
|
204
227
|
exports.LifxPlatformAccessory = LifxPlatformAccessory;
|
|
205
228
|
//# 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;
|
|
1
|
+
{"version":3,"file":"platformAccess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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,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,UAAU;QACrB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3B,CAAC;CAEF;AA1QD,sDA0QC"}
|
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.
|
|
5
|
+
"version": "0.1.4",
|
|
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": {
|