@nmrenard/homebridge-ambient-lights-aurora 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # homebridge-ambient-lights-aurora
2
+ Homebridge Ambient Lights - Aurora
3
+
4
+ This allows you to control the [Aurora Ambient LED Project](https://github.com/AndrewMohawk/Aurora) via Homekit.
5
+
6
+ <p align="center">
7
+
8
+ ![Basic Controls](./readme_assets/homebridge-aurora-basic-control.png)
9
+ ![Basic Button](./readme_assets/homebridge-plugin-settings.png)
10
+
11
+ </p>
12
+
13
+ ## Installation
14
+ npm i -g homebridge-ambient-lights-aurora
15
+
16
+ ## Homebridge Configuration
17
+
18
+ Add the `HomeBridge - Ambient Lights Aurora` platform in your homebridge `config.json` file. And set up at least 1 `auroras`
19
+
20
+ ### Easiest configuration
21
+ For the best experience setting up this plugin, please use [homebridge-config-ui-x](https://www.npmjs.com/package/homebridge-config-ui-x) or [HOOBS](https://hoobs.org/). Both have a UI that will walk you through adding required fields.
22
+
23
+ ### Basic configuration
24
+ ```json
25
+ {
26
+ "platforms": [
27
+ {
28
+ "platform": "HomeBridge - Ambient Lights Aurora",
29
+ "auroras": [
30
+ {
31
+ "ipAddress": "192.168.1.190",
32
+ "piName": "Aurora Pi",
33
+ "extension": "Aurora_Ambient_AutoCrop"
34
+ }
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ ```
40
+
41
+ ## Switching Extensions
42
+
43
+ [Aurora Extensions](https://github.com/AndrewMohawk/Aurora/tree/master/extensions)
44
+ There are currently 5 active extensions made by Andrew. Since this plugin uses a Lightbulb service the Brightness switches between Extension modes.
45
+
46
+ (I don't think this is totally logical, but I figure Audio is minimal brightness then worked by way up to the best modes)
47
+ - 100-80 - Autocrop
48
+ - 79-60 - No crop
49
+ - 59-40 - Rainbow
50
+ - 39-20 - Meteor
51
+ - 19-0 - Audio Spectogram
52
+
53
+ ## Issues
54
+
55
+ Currently there is no easy way to grab the current status of the Aurora system so when the plugin initially runs it assumes Aurora is:
56
+
57
+ - Off
58
+ - Autocrop is the current Extension Loaded
@@ -0,0 +1,44 @@
1
+ {
2
+ "pluginAlias": "HomeBridge - Ambient Lights Aurora",
3
+ "pluginType": "platform",
4
+ "singular": true,
5
+ "schema": {
6
+ "type": "object",
7
+ "properties": {
8
+ "auroras": {
9
+ "title": "Auroras (Raspberry Pis)",
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "properties": {
14
+ "piName": {
15
+ "title": "Raspberry Pi Name",
16
+ "type": "string",
17
+ "required": true,
18
+ "default": "Raspberry Pi"
19
+ },
20
+ "ipAddress": {
21
+ "title": "IP Address",
22
+ "type": "string",
23
+ "required": true,
24
+ "placeholder": "192.168.x.x"
25
+ },
26
+ "extension": {
27
+ "title": "Default Extension",
28
+ "type": "string",
29
+ "default": "Aurora_Ambient_AutoCrop",
30
+ "oneOf": [
31
+ { "title": "Aurora Ambient Lighting ( AutoCrop )", "enum": ["Aurora_Ambient_AutoCrop"] },
32
+ { "title": "Aurora Ambient Lighting", "enum": ["Aurora_Ambient_NoCrop"] },
33
+ { "title": "Aurora Rainbow Display ( LED Only )", "enum": ["Aurora_Rainbow"] },
34
+ { "title": "Aurora Meteor Display ( LED Only )", "enum": ["Aurora_Meteor"] },
35
+ { "title": "Aurora Audio Spectrogram", "enum": ["Aurora_AudioSpectogram"] }
36
+ ],
37
+ "required": true
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,7 @@
1
+ import { API } from 'homebridge';
2
+ /**
3
+ * This method registers the platform with Homebridge
4
+ */
5
+ declare const _default: (api: API) => void;
6
+ export = _default;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAKjC;;GAEG;yBACO,KAAK,GAAG;AAAlB,kBAEE"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ const settings_1 = require("./settings");
3
+ const platform_1 = require("./platform");
4
+ module.exports = (api) => {
5
+ api.registerPlatform(settings_1.PLATFORM_NAME, platform_1.AmbientLightAuroraPlatform);
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,yCAA2C;AAC3C,yCAAwD;AAKxD,iBAAS,CAAC,GAAQ,EAAE,EAAE;IAClB,GAAG,CAAC,gBAAgB,CAAC,wBAAa,EAAE,qCAA0B,CAAC,CAAC;AACpE,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, Service, Characteristic } from 'homebridge';
2
+ /**
3
+ * HomebridgePlatform
4
+ * This class is the main constructor for your plugin, this is where you should
5
+ * parse the user config and discover/register accessories with Homebridge.
6
+ */
7
+ export declare class AmbientLightAuroraPlatform implements DynamicPlatformPlugin {
8
+ readonly log: Logger;
9
+ readonly config: PlatformConfig;
10
+ readonly api: API;
11
+ readonly Service: typeof Service;
12
+ readonly Characteristic: typeof Characteristic;
13
+ readonly accessories: PlatformAccessory[];
14
+ constructor(log: Logger, config: PlatformConfig, api: API);
15
+ /**
16
+ * This function is invoked when homebridge restores cached accessories from disk at startup.
17
+ * It should be used to setup event handlers for characteristics and update respective values.
18
+ */
19
+ configureAccessory(accessory: PlatformAccessory): void;
20
+ /**
21
+ * This is an example method showing how to register discovered accessories.
22
+ * Accessories must only be registered once, previously created accessories
23
+ * must not be registered again to prevent "duplicate UUID" errors.
24
+ */
25
+ discoverDevices(): void;
26
+ }
27
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +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;AAK5H;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,qBAAqB;aAQhD,GAAG,EAAE,MAAM;aACX,MAAM,EAAE,cAAc;aACtB,GAAG,EAAE,GAAG;IAT5B,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CAA+B;IAGpF,SAAgB,WAAW,EAAE,iBAAiB,EAAE,CAAM;gBAGlC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG;IAe5B;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAO/C;;;;OAIG;IACH,eAAe;CAqBlB"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AmbientLightAuroraPlatform = void 0;
4
+ const settings_1 = require("./settings");
5
+ const platformAccessory_1 = require("./platformAccessory");
6
+ /**
7
+ * HomebridgePlatform
8
+ * This class is the main constructor for your plugin, this is where you should
9
+ * parse the user config and discover/register accessories with Homebridge.
10
+ */
11
+ class AmbientLightAuroraPlatform {
12
+ constructor(log, config, api) {
13
+ this.log = log;
14
+ this.config = config;
15
+ this.api = api;
16
+ this.Service = this.api.hap.Service;
17
+ this.Characteristic = this.api.hap.Characteristic;
18
+ // this is used to track restored cached accessories
19
+ this.accessories = [];
20
+ this.log.debug('Finished initializing platform'); //, JSON.stringify(this.config));
21
+ // When this event is fired it means Homebridge has restored all cached accessories from disk.
22
+ // Dynamic Platform plugins should only register new accessories after this event was fired,
23
+ // in order to ensure they weren't added to homebridge already. This event can also be used
24
+ // to start discovery of new accessories.
25
+ this.api.on('didFinishLaunching', () => {
26
+ log.debug('Executed didFinishLaunching callback');
27
+ // run the method to discover / register your devices as accessories
28
+ this.discoverDevices();
29
+ });
30
+ }
31
+ /**
32
+ * This function is invoked when homebridge restores cached accessories from disk at startup.
33
+ * It should be used to setup event handlers for characteristics and update respective values.
34
+ */
35
+ configureAccessory(accessory) {
36
+ this.log.info('Loading accessory from cache:', accessory.displayName);
37
+ // add the restored accessory to the accessories cache so we can track if it has already been registered
38
+ this.accessories.push(accessory);
39
+ }
40
+ /**
41
+ * This is an example method showing how to register discovered accessories.
42
+ * Accessories must only be registered once, previously created accessories
43
+ * must not be registered again to prevent "duplicate UUID" errors.
44
+ */
45
+ discoverDevices() {
46
+ this.log.info('Aurora discoverDevices');
47
+ for (const aurora of this.config.auroras) {
48
+ const uuid = this.api.hap.uuid.generate(aurora.piName);
49
+ const existingAccessory = this.accessories.find(accessory => accessory.UUID === uuid);
50
+ if (existingAccessory) {
51
+ // the accessory already exists
52
+ this.log.info('Restoring existing accessory from cache:', aurora.piName);
53
+ existingAccessory.context.device = aurora;
54
+ new platformAccessory_1.AmbientLightAuroraPlatformAccessory(this, existingAccessory);
55
+ this.api.updatePlatformAccessories([existingAccessory]);
56
+ }
57
+ else {
58
+ this.log.info('Adding new accessory:', aurora.piName);
59
+ const accessory = new this.api.platformAccessory(aurora.piName, uuid);
60
+ accessory.context.device = aurora;
61
+ new platformAccessory_1.AmbientLightAuroraPlatformAccessory(this, accessory);
62
+ this.api.registerPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [accessory]);
63
+ }
64
+ }
65
+ }
66
+ }
67
+ exports.AmbientLightAuroraPlatform = AmbientLightAuroraPlatform;
68
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;AAEA,yCAAwD;AACxD,2DAA0E;AAE1E;;;;GAIG;AACH,MAAa,0BAA0B;IAOnC,YACoB,GAAW,EACX,MAAsB,EACtB,GAAQ;QAFR,QAAG,GAAH,GAAG,CAAQ;QACX,WAAM,GAAN,MAAM,CAAgB;QACtB,QAAG,GAAH,GAAG,CAAK;QATZ,YAAO,GAAmB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;QAC/C,mBAAc,GAA0B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QAEpF,oDAAoD;QACpC,gBAAW,GAAwB,EAAE,CAAC;QAOlD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC,CAAA,iCAAiC;QAElF,8FAA8F;QAC9F,4FAA4F;QAC5F,2FAA2F;QAC3F,yCAAyC;QACzC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;YACnC,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AI,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBACtE,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;gBAClC,IAAI,uDAAmC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;gBACzD,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,sBAAW,EAAE,wBAAa,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;YAClF,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AA9DD,gEA8DC"}
@@ -0,0 +1,24 @@
1
+ import { PlatformAccessory, CharacteristicValue } from 'homebridge';
2
+ import { AmbientLightAuroraPlatform } from './platform';
3
+ /**
4
+ * Platform Accessory
5
+ * An instance of this class is created for each accessory your platform registers
6
+ * Each accessory may expose multiple services of different service types.
7
+ */
8
+ export declare class AmbientLightAuroraPlatformAccessory {
9
+ private readonly platform;
10
+ private readonly accessory;
11
+ private auroraService;
12
+ /**
13
+ * These are just used to create a working example
14
+ * You should implement your own code to track the state of your accessory
15
+ */
16
+ private auroraState;
17
+ constructor(platform: AmbientLightAuroraPlatform, accessory: PlatformAccessory);
18
+ ensureServiceUp(): Promise<CharacteristicValue>;
19
+ setAuroraOn(value: CharacteristicValue): Promise<void>;
20
+ getAuroraOn(): Promise<CharacteristicValue>;
21
+ setAuroraBrightness(value: CharacteristicValue): Promise<void>;
22
+ getAuroraBrightness(): Promise<CharacteristicValue>;
23
+ }
24
+ //# sourceMappingURL=platformAccessory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformAccessory.d.ts","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD;;;;GAIG;AACH,qBAAa,mCAAmC;IAmBxC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAlB9B,OAAO,CAAC,aAAa,CAAU;IAE/B;;;OAGG;IAMH,OAAO,CAAC,WAAW,CAGjB;gBAGmB,QAAQ,EAAE,0BAA0B,EACpC,SAAS,EAAE,iBAAiB;IAgB3C,eAAe,IAAI,OAAO,CAAC,mBAAmB,CAAC;IA6B/C,WAAW,CAAC,KAAK,EAAE,mBAAmB;IA2CtC,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAY3C,mBAAmB,CAAC,KAAK,EAAE,mBAAmB;IAuD9C,mBAAmB,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAW5D"}
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AmbientLightAuroraPlatformAccessory = void 0;
37
+ const http = __importStar(require("http"));
38
+ /**
39
+ * Platform Accessory
40
+ * An instance of this class is created for each accessory your platform registers
41
+ * Each accessory may expose multiple services of different service types.
42
+ */
43
+ class AmbientLightAuroraPlatformAccessory {
44
+ constructor(platform, accessory) {
45
+ this.platform = platform;
46
+ this.accessory = accessory;
47
+ /**
48
+ * These are just used to create a working example
49
+ * You should implement your own code to track the state of your accessory
50
+ */
51
+ // private exampleStates = {
52
+ // On: false,
53
+ // Brightness: 100,
54
+ // };
55
+ this.auroraState = {
56
+ On: false,
57
+ Brightness: 100,
58
+ };
59
+ this.auroraService = this.accessory.getService(this.platform.Service.Lightbulb) ||
60
+ this.accessory.addService(this.platform.Service.Lightbulb);
61
+ this.auroraService.setCharacteristic(this.platform.Characteristic.Name, accessory.context.device.name);
62
+ this.auroraService.getCharacteristic(this.platform.Characteristic.On)
63
+ .onSet(this.setAuroraOn.bind(this))
64
+ .onGet(this.getAuroraOn.bind(this));
65
+ this.auroraService.getCharacteristic(this.platform.Characteristic.Brightness)
66
+ .onSet(this.setAuroraBrightness.bind(this))
67
+ .onGet(this.getAuroraBrightness.bind(this));
68
+ }
69
+ async ensureServiceUp() {
70
+ return new Promise((accept, reject) => {
71
+ http.get(`http://${this.accessory.context.device.ipAddress}`, (res) => {
72
+ let data = '';
73
+ res.on('data', (chunk) => {
74
+ data += chunk;
75
+ });
76
+ res.on('end', () => {
77
+ //this.platform.log.debug(JSON.parse(data));
78
+ const isString = typeof data;
79
+ if (isString) {
80
+ //return true;
81
+ accept(true);
82
+ return;
83
+ }
84
+ reject(false);
85
+ return false;
86
+ });
87
+ }).on('error', (err) => {
88
+ this.platform.log.error('Error: ', err.message);
89
+ reject(false);
90
+ return false;
91
+ });
92
+ });
93
+ }
94
+ async setAuroraOn(value) {
95
+ this.auroraState.On = value;
96
+ this.platform.log.info('Aurora On State: ', this.auroraState.On.toString());
97
+ const isServiceEnabled = await this.ensureServiceUp();
98
+ if (isServiceEnabled) {
99
+ const data = JSON.stringify({
100
+ enabled: this.auroraState.On,
101
+ });
102
+ const updateConfigOptions = {
103
+ protocol: 'http:',
104
+ hostname: this.accessory.context.device.ipAddress,
105
+ port: 80,
106
+ path: '/update_config',
107
+ method: 'POST',
108
+ headers: {
109
+ 'Content-Type': 'application/json',
110
+ 'Content-Length': data.length,
111
+ },
112
+ };
113
+ const req = http.request(updateConfigOptions, (res) => {
114
+ let data = '';
115
+ res.on('data', (chunk) => {
116
+ data += chunk;
117
+ });
118
+ res.on('end', () => {
119
+ this.platform.log.debug(JSON.parse(data));
120
+ this.platform.log.debug('Set Aurora On =>', value);
121
+ });
122
+ }).on('error', (err) => {
123
+ this.platform.log.error('Error: ', err.message);
124
+ });
125
+ req.write(data);
126
+ req.end();
127
+ }
128
+ }
129
+ async getAuroraOn() {
130
+ // implement your own code to check if the device is on
131
+ const isOn = this.auroraState.On;
132
+ this.platform.log.debug('Get Characteristic On ->', isOn);
133
+ // if you need to return an error to show the device as "Not Responding" in the Home app:
134
+ // throw new this.platform.api.hap.HapStatusError(this.platform.api.hap.HAPStatus.SERVICE_COMMUNICATION_FAILURE);
135
+ return isOn;
136
+ }
137
+ async setAuroraBrightness(value) {
138
+ this.auroraState.Brightness = value;
139
+ this.platform.log.info('Aurora Brightness State: ', this.auroraState.Brightness.toString());
140
+ const isServiceEnabled = await this.ensureServiceUp();
141
+ if (isServiceEnabled) {
142
+ const brightness = this.auroraState.Brightness;
143
+ let extension = 'Aurora_Ambient_AutoCrop';
144
+ if (brightness < 20) {
145
+ extension = 'Aurora_AudioSpectogram';
146
+ }
147
+ else if (brightness < 40) {
148
+ extension = 'Aurora_Meteor';
149
+ }
150
+ else if (brightness < 60) {
151
+ extension = 'Aurora_Rainbow';
152
+ }
153
+ else if (brightness < 80) {
154
+ extension = 'Aurora_Ambient_NoCrop';
155
+ }
156
+ const data = JSON.stringify({
157
+ extension_name: extension,
158
+ });
159
+ const updateConfigOptions = {
160
+ protocol: 'http:',
161
+ hostname: this.accessory.context.device.ipAddress,
162
+ port: 80,
163
+ path: '/update_extension',
164
+ method: 'POST',
165
+ headers: {
166
+ 'Content-Type': 'application/json',
167
+ 'Content-Length': data.length,
168
+ },
169
+ };
170
+ const req = http.request(updateConfigOptions, (res) => {
171
+ let data = '';
172
+ res.on('data', (chunk) => {
173
+ data += chunk;
174
+ });
175
+ res.on('end', () => {
176
+ this.platform.log.debug(JSON.parse(data));
177
+ this.platform.log.debug('Set Aurora Extension =>', extension);
178
+ });
179
+ }).on('error', (err) => {
180
+ this.platform.log.error('Error: ', err.message);
181
+ });
182
+ req.write(data);
183
+ req.end();
184
+ }
185
+ }
186
+ async getAuroraBrightness() {
187
+ // implement your own code to check if the device is on
188
+ const brightness = this.auroraState.Brightness;
189
+ this.platform.log.debug('Get Aurora Brightness ->', brightness);
190
+ // if you need to return an error to show the device as "Not Responding" in the Home app:
191
+ // throw new this.platform.api.hap.HapStatusError(this.platform.api.hap.HAPStatus.SERVICE_COMMUNICATION_FAILURE);
192
+ return brightness;
193
+ }
194
+ }
195
+ exports.AmbientLightAuroraPlatformAccessory = AmbientLightAuroraPlatformAccessory;
196
+ //# sourceMappingURL=platformAccessory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformAccessory.js","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAM7B;;;;GAIG;AACH,MAAa,mCAAmC;IAkB5C,YACqB,QAAoC,EACpC,SAA4B;QAD5B,aAAQ,GAAR,QAAQ,CAA4B;QACpC,cAAS,GAAT,SAAS,CAAmB;QAhBjD;;;WAGG;QACH,4BAA4B;QAC5B,eAAe;QACf,qBAAqB;QACrB,KAAK;QAEG,gBAAW,GAAG;YAClB,EAAE,EAAE,KAAK;YACT,U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CAAC,GAAG,EAAE,EAAE;gBAClD,IAAI,IAAI,GAAG,EAAE,CAAC;gBAEd,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;oBACrB,IAAI,IAAI,KAAK,CAAC;gBAClB,CAAC,CAAC,CAAC;gBAEH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;oBACf,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;oBAC1C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;gBAClE,CAAC,CAAC,CAAC;YAEP,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACnB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChB,GAAG,CAAC,GAAG,EAAE,CAAC;QACd,CAAC;IACL,CAAC;IAED,KAAK,CAAC,mBAAmB;QACrB,uDAAuD;QACvD,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;QAE/C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAC;QAEhE,yFAAyF;QACzF,iHAAiH;QAEjH,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ;AA1LD,kFA0LC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This is the name of the platform that users will use to register the plugin in the Homebridge config.json
3
+ */
4
+ export declare const PLATFORM_NAME = "HomeBridge - Ambient Lights Aurora";
5
+ /**
6
+ * This must match the name of your plugin as defined the package.json
7
+ */
8
+ export declare const PLUGIN_NAME = "homebridge-ambient-lights-aurora";
9
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa,uCAAuC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,WAAW,qCAAqC,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PLUGIN_NAME = exports.PLATFORM_NAME = void 0;
4
+ /**
5
+ * This is the name of the platform that users will use to register the plugin in the Homebridge config.json
6
+ */
7
+ exports.PLATFORM_NAME = 'HomeBridge - Ambient Lights Aurora';
8
+ /**
9
+ * This must match the name of your plugin as defined the package.json
10
+ */
11
+ exports.PLUGIN_NAME = 'homebridge-ambient-lights-aurora';
12
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,aAAa,GAAG,oCAAoC,CAAC;AAElE;;GAEG;AACU,QAAA,WAAW,GAAG,kCAAkC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import eslint from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+
4
+ export default [
5
+ eslint.configs.recommended,
6
+ ...tseslint.configs.recommended,
7
+ {
8
+ files: ['src/**/*.ts'],
9
+ rules: {
10
+ 'quotes': ['warn', 'single'],
11
+ 'indent': ['warn', 4, { 'SwitchCase': 1 }],
12
+ 'semi': ['off'],
13
+ 'comma-dangle': ['warn', 'always-multiline'],
14
+ 'dot-notation': 'off',
15
+ 'eqeqeq': 'warn',
16
+ 'curly': ['warn', 'all'],
17
+ 'brace-style': ['warn'],
18
+ 'prefer-arrow-callback': ['warn'],
19
+ 'max-len': ['warn', 140],
20
+ 'no-console': ['warn'],
21
+ 'comma-spacing': ['error'],
22
+ 'no-multi-spaces': ['warn', { 'ignoreEOLComments': true }],
23
+ 'no-trailing-spaces': ['warn'],
24
+ 'lines-between-class-members': ['warn', 'always', { 'exceptAfterSingleLine': true }],
25
+ '@typescript-eslint/explicit-function-return-type': 'off',
26
+ '@typescript-eslint/no-non-null-assertion': 'off',
27
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
28
+ },
29
+ },
30
+ {
31
+ ignores: ['dist/**'],
32
+ },
33
+ ];
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "displayName": "Homebridge Ambient Lights Aurora",
3
+ "name": "@nmrenard/homebridge-ambient-lights-aurora",
4
+ "version": "0.2.1",
5
+ "description": "Interfaces with a Raspberry Pi to allow a user to turn on and off the Aurora system. This is based on this github project: https://github.com/AndrewMohawk/Aurora NOT Aurora switches.",
6
+ "license": "Apache-2.0",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git@github.com:JonVisc/homebridge-ambient-lights-aurora.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/JonVisc/homebridge-ambient-lights-aurora/issues"
13
+ },
14
+ "engines": {
15
+ "node": ">=18.0.0",
16
+ "homebridge": ">=1.3.0"
17
+ },
18
+ "main": "dist/index.js",
19
+ "scripts": {
20
+ "lint": "eslint src/**.ts --max-warnings=0",
21
+ "watch": "npm run build && npm link && nodemon",
22
+ "build": "rimraf ./dist && tsc",
23
+ "prepublishOnly": "npm run lint && npm run build"
24
+ },
25
+ "keywords": [
26
+ "homebridge-plugin",
27
+ "ambient-lights",
28
+ "aurora",
29
+ "Andrew Mohawk",
30
+ "tv"
31
+ ],
32
+ "devDependencies": {
33
+ "@eslint/js": "^9.39.2",
34
+ "@types/node": "^25.0.3",
35
+ "@typescript-eslint/eslint-plugin": "^8.52.0",
36
+ "@typescript-eslint/parser": "^8.52.0",
37
+ "eslint": "^9.39.2",
38
+ "homebridge": "^1.3.1",
39
+ "nodemon": "^3.1.11",
40
+ "rimraf": "^6.1.2",
41
+ "ts-node": "^10.9.2",
42
+ "typescript": "^5.9.3",
43
+ "typescript-eslint": "^8.52.0"
44
+ }
45
+ }