@switchbot/homebridge-switchbot 1.12.7-beta.5 → 1.12.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/config.schema.json +6 -6
  3. package/dist/device/bot.js +2 -2
  4. package/dist/device/bot.js.map +1 -1
  5. package/dist/device/colorbulb.d.ts +0 -6
  6. package/dist/device/colorbulb.d.ts.map +1 -1
  7. package/dist/device/colorbulb.js +74 -89
  8. package/dist/device/colorbulb.js.map +1 -1
  9. package/dist/device/curtain.js +1 -1
  10. package/dist/device/curtain.js.map +1 -1
  11. package/dist/device/humidifier.js +2 -2
  12. package/dist/device/humidifier.js.map +1 -1
  13. package/dist/device/lock.d.ts.map +1 -1
  14. package/dist/device/lock.js +1 -21
  15. package/dist/device/lock.js.map +1 -1
  16. package/dist/device/meter.d.ts +0 -1
  17. package/dist/device/meter.d.ts.map +1 -1
  18. package/dist/device/meter.js +1 -14
  19. package/dist/device/meter.js.map +1 -1
  20. package/dist/device/meterplus.d.ts +76 -0
  21. package/dist/device/meterplus.d.ts.map +1 -0
  22. package/dist/device/meterplus.js +464 -0
  23. package/dist/device/meterplus.js.map +1 -0
  24. package/dist/device/plug.js +1 -1
  25. package/dist/device/plug.js.map +1 -1
  26. package/dist/device/striplight.d.ts +90 -0
  27. package/dist/device/striplight.d.ts.map +1 -0
  28. package/dist/device/striplight.js +487 -0
  29. package/dist/device/striplight.js.map +1 -0
  30. package/dist/platform.d.ts +2 -0
  31. package/dist/platform.d.ts.map +1 -1
  32. package/dist/platform.js +119 -9
  33. package/dist/platform.js.map +1 -1
  34. package/package.json +76 -76
  35. package/src/device/bot.ts +2 -2
  36. package/src/device/colorbulb.ts +74 -89
  37. package/src/device/curtain.ts +1 -1
  38. package/src/device/humidifier.ts +2 -2
  39. package/src/device/lock.ts +1 -21
  40. package/src/device/meter.ts +1 -13
  41. package/src/device/meterplus.ts +518 -0
  42. package/src/device/plug.ts +1 -1
  43. package/src/device/striplight.ts +583 -0
  44. package/src/platform.ts +127 -9
@@ -0,0 +1,90 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { Subject } from 'rxjs';
3
+ import { SwitchBotPlatform } from '../platform';
4
+ import { Service, PlatformAccessory, CharacteristicValue, ControllerConstructor, Controller, ControllerServiceMap } from 'homebridge';
5
+ import { device, devicesConfig, switchbot, deviceStatusResponse, deviceStatus } from '../settings';
6
+ /**
7
+ * Platform Accessory
8
+ * An instance of this class is created for each accessory your platform registers
9
+ * Each accessory may expose multiple services of different service types.
10
+ */
11
+ export declare class StripLight {
12
+ private readonly platform;
13
+ private accessory;
14
+ device: device & devicesConfig;
15
+ lightBulbService: Service;
16
+ On: CharacteristicValue;
17
+ OnCached: CharacteristicValue;
18
+ Hue: CharacteristicValue;
19
+ HueCached: CharacteristicValue;
20
+ Saturation: CharacteristicValue;
21
+ SaturationCached: CharacteristicValue;
22
+ Brightness: CharacteristicValue;
23
+ BrightnessCached: CharacteristicValue;
24
+ power: deviceStatus['power'];
25
+ color: deviceStatus['color'];
26
+ brightness: deviceStatus['brightness'];
27
+ deviceStatus: deviceStatusResponse;
28
+ switchbot: switchbot;
29
+ set_minStep?: number;
30
+ deviceLogging: string;
31
+ deviceRefreshRate: number;
32
+ adaptiveLightingShift?: number;
33
+ AdaptiveLightingController?: ControllerConstructor | Controller<ControllerServiceMap>;
34
+ minKelvin: number;
35
+ maxKelvin: number;
36
+ cacheKelvin: number;
37
+ colorBulbUpdateInProgress: boolean;
38
+ doColorBulbUpdate: Subject<void>;
39
+ constructor(platform: SwitchBotPlatform, accessory: PlatformAccessory, device: device & devicesConfig);
40
+ parseStatus(): Promise<void>;
41
+ refreshStatus(): Promise<void>;
42
+ /**
43
+ * Pushes the requested changes to the SwitchBot API
44
+ * deviceType commandType Command command parameter Description
45
+ * Strip Light - "command" "turnOn" "default" = set to ON state |
46
+ * Strip Light - "command" "turnOff" "default" = set to OFF state |
47
+ * Strip Light - "command" "toggle" "default" = toggle state |
48
+ * Strip Light - "command" "setBrightness" "`{1-100}`" = set brightness |
49
+ * Strip Light - "command" "setColor" "`"{0-255}:{0-255}:{0-255}"`" = set RGB color value |
50
+ *
51
+ */
52
+ pushChanges(): Promise<void>;
53
+ pushHueSaturationChanges(): Promise<void>;
54
+ pushBrightnessChanges(): Promise<void>;
55
+ updateHomeKitCharacteristics(): Promise<void>;
56
+ apiError(e: any): void;
57
+ statusCode(push: AxiosResponse<{
58
+ statusCode: number;
59
+ }>): void;
60
+ offlineOff(): Promise<void>;
61
+ /**
62
+ * Handle requests to set the value of the "On" characteristic
63
+ */
64
+ OnSet(value: CharacteristicValue): Promise<void>;
65
+ /**
66
+ * Handle requests to set the value of the "Brightness" characteristic
67
+ */
68
+ BrightnessSet(value: CharacteristicValue): Promise<void>;
69
+ /**
70
+ * Handle requests to set the value of the "Hue" characteristic
71
+ */
72
+ HueSet(value: CharacteristicValue): Promise<void>;
73
+ /**
74
+ * Handle requests to set the value of the "Saturation" characteristic
75
+ */
76
+ SaturationSet(value: CharacteristicValue): Promise<void>;
77
+ config(device: device & devicesConfig): Promise<void>;
78
+ refreshRate(device: device & devicesConfig): Promise<void>;
79
+ logs(device: device & devicesConfig): Promise<void>;
80
+ minStep(device: device & devicesConfig): number;
81
+ /**
82
+ * Logging for Device
83
+ */
84
+ infoLog(...log: any[]): void;
85
+ warnLog(...log: any[]): void;
86
+ errorLog(...log: any[]): void;
87
+ debugLog(...log: any[]): void;
88
+ enablingDeviceLogging(): boolean;
89
+ }
90
+ //# sourceMappingURL=striplight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"striplight.d.ts","sourceRoot":"","sources":["../../src/device/striplight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAY,OAAO,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE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M;IAS/C;;OAEG;IACH,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5B,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5B,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM7B,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAU7B,qBAAqB,IAAI,OAAO;CAGjC"}
@@ -0,0 +1,487 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StripLight = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const settings_1 = require("../settings");
7
+ /**
8
+ * Platform Accessory
9
+ * An instance of this class is created for each accessory your platform registers
10
+ * Each accessory may expose multiple services of different service types.
11
+ */
12
+ class StripLight {
13
+ constructor(platform, accessory, device) {
14
+ this.platform = platform;
15
+ this.accessory = accessory;
16
+ this.device = device;
17
+ // default placeholders
18
+ this.logs(device);
19
+ this.refreshRate(device);
20
+ this.config(device);
21
+ if (this.On === undefined) {
22
+ this.On = false;
23
+ }
24
+ else {
25
+ this.On = this.accessory.context.On;
26
+ }
27
+ this.Hue = 0;
28
+ this.Brightness = 0;
29
+ this.Saturation = 0;
30
+ this.minKelvin = 2000;
31
+ this.maxKelvin = 9000;
32
+ // this is subject we use to track when we need to POST changes to the SwitchBot API
33
+ this.doColorBulbUpdate = new rxjs_1.Subject();
34
+ this.colorBulbUpdateInProgress = false;
35
+ // Retrieve initial values and updateHomekit
36
+ this.refreshStatus();
37
+ // set accessory information
38
+ accessory
39
+ .getService(this.platform.Service.AccessoryInformation)
40
+ .setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
41
+ .setCharacteristic(this.platform.Characteristic.Model, 'W1701100')
42
+ .setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId);
43
+ // get the Lightbulb service if it exists, otherwise create a new Lightbulb service
44
+ // you can create multiple services for each accessory
45
+ (this.lightBulbService = accessory.getService(this.platform.Service.Lightbulb) || accessory.addService(this.platform.Service.Lightbulb)),
46
+ `${accessory.displayName} Strip Light`;
47
+ // To avoid "Cannot add a Service with the same UUID another Service without also defining a unique 'subtype' property." error,
48
+ // when creating multiple services of the same type, you need to use the following syntax to specify a name and subtype id:
49
+ // accessory.getService('NAME') ?? accessory.addService(this.platform.Service.Outlet, 'NAME', 'USER_DEFINED_SUBTYPE');
50
+ // set the service name, this is what is displayed as the default name on the Home app
51
+ // in this example we are using the name we stored in the `accessory.context` in the `discoverDevices` method.
52
+ this.lightBulbService.setCharacteristic(this.platform.Characteristic.Name, accessory.displayName);
53
+ // handle on / off events using the On characteristic
54
+ this.lightBulbService.getCharacteristic(this.platform.Characteristic.On).onSet(this.OnSet.bind(this));
55
+ // handle Brightness events using the Brightness characteristic
56
+ this.lightBulbService
57
+ .getCharacteristic(this.platform.Characteristic.Brightness)
58
+ .setProps({
59
+ minStep: this.minStep(device),
60
+ minValue: 0,
61
+ maxValue: 100,
62
+ validValueRanges: [0, 100],
63
+ })
64
+ .onGet(() => {
65
+ return this.Brightness;
66
+ })
67
+ .onSet(this.BrightnessSet.bind(this));
68
+ // handle Hue events using the Hue characteristic
69
+ this.lightBulbService
70
+ .getCharacteristic(this.platform.Characteristic.Hue)
71
+ .setProps({
72
+ minValue: 0,
73
+ maxValue: 360,
74
+ validValueRanges: [0, 360],
75
+ })
76
+ .onGet(() => {
77
+ return this.Hue;
78
+ })
79
+ .onSet(this.HueSet.bind(this));
80
+ // handle Hue events using the Hue characteristic
81
+ this.lightBulbService
82
+ .getCharacteristic(this.platform.Characteristic.Saturation)
83
+ .setProps({
84
+ minValue: 0,
85
+ maxValue: 100,
86
+ validValueRanges: [0, 100],
87
+ })
88
+ .onGet(() => {
89
+ return this.Saturation;
90
+ })
91
+ .onSet(this.SaturationSet.bind(this));
92
+ // Update Homekit
93
+ this.updateHomeKitCharacteristics();
94
+ // Start an update interval
95
+ (0, rxjs_1.interval)(this.deviceRefreshRate * 1000)
96
+ .pipe((0, operators_1.skipWhile)(() => this.colorBulbUpdateInProgress))
97
+ .subscribe(async () => {
98
+ await this.refreshStatus();
99
+ });
100
+ // Watch for Bulb change events
101
+ // We put in a debounce of 100ms so we don't make duplicate calls
102
+ this.doColorBulbUpdate
103
+ .pipe((0, operators_1.tap)(() => {
104
+ this.colorBulbUpdateInProgress = true;
105
+ }), (0, operators_1.debounceTime)(this.platform.config.options.pushRate * 1000))
106
+ .subscribe(async () => {
107
+ try {
108
+ await this.pushChanges();
109
+ }
110
+ catch (e) {
111
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed pushChanges`);
112
+ if (this.deviceLogging.includes('debug')) {
113
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed pushChanges,` + ` Error Message: ${JSON.stringify(e.message)}`);
114
+ }
115
+ this.apiError(e);
116
+ }
117
+ this.colorBulbUpdateInProgress = false;
118
+ });
119
+ }
120
+ async parseStatus() {
121
+ switch (this.power) {
122
+ case 'on':
123
+ this.On = true;
124
+ break;
125
+ default:
126
+ this.On = false;
127
+ }
128
+ this.debugLog(`Strip Light: ${this.accessory.displayName} On: ${this.On}`);
129
+ // Brightness
130
+ this.Brightness = Number(this.brightness);
131
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Brightness: ${this.Brightness}`);
132
+ // Color, Hue & Brightness
133
+ if (this.color) {
134
+ this.debugLog(`Strip Light: ${this.accessory.displayName} color: ${JSON.stringify(this.color)}`);
135
+ const [red, green, blue] = this.color.split(':');
136
+ this.debugLog(`Strip Light: ${this.accessory.displayName} red: ${JSON.stringify(red)}`);
137
+ this.debugLog(`Strip Light: ${this.accessory.displayName} green: ${JSON.stringify(green)}`);
138
+ this.debugLog(`Strip Light: ${this.accessory.displayName} blue: ${JSON.stringify(blue)}`);
139
+ const [hue, saturation] = (0, settings_1.rgb2hs)(Number(red), Number(green), Number(blue));
140
+ this.debugLog(`Strip Light: ${this.accessory.displayName} hs: ${JSON.stringify((0, settings_1.rgb2hs)(Number(red), Number(green), Number(blue)))}`);
141
+ // Hue
142
+ this.Hue = hue;
143
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Hue: ${this.Hue}`);
144
+ // Saturation
145
+ this.Saturation = saturation;
146
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Saturation: ${this.Saturation}`);
147
+ }
148
+ }
149
+ async refreshStatus() {
150
+ try {
151
+ this.deviceStatus = (await this.platform.axios.get(`${settings_1.DeviceURL}/${this.device.deviceId}/status`)).data;
152
+ this.debugLog(`Strip Light: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(this.deviceStatus)}`);
153
+ this.power = this.deviceStatus.body.power;
154
+ this.color = this.deviceStatus.body.color;
155
+ this.brightness = this.deviceStatus.body.brightness;
156
+ this.parseStatus();
157
+ this.updateHomeKitCharacteristics();
158
+ }
159
+ catch (e) {
160
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed refreshStatus with OpenAPI Connection`);
161
+ if (this.deviceLogging.includes('debug')) {
162
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed refreshStatus with OpenAPI Connection,` +
163
+ ` Error Message: ${JSON.stringify(e.message)}`);
164
+ }
165
+ this.apiError(e);
166
+ }
167
+ }
168
+ /**
169
+ * Pushes the requested changes to the SwitchBot API
170
+ * deviceType commandType Command command parameter Description
171
+ * Strip Light - "command" "turnOn" "default" = set to ON state |
172
+ * Strip Light - "command" "turnOff" "default" = set to OFF state |
173
+ * Strip Light - "command" "toggle" "default" = toggle state |
174
+ * Strip Light - "command" "setBrightness" "`{1-100}`" = set brightness |
175
+ * Strip Light - "command" "setColor" "`"{0-255}:{0-255}:{0-255}"`" = set RGB color value |
176
+ *
177
+ */
178
+ async pushChanges() {
179
+ try {
180
+ if (this.On !== this.OnCached) {
181
+ // Push On Update
182
+ const payload = {
183
+ commandType: 'command',
184
+ parameter: 'default',
185
+ };
186
+ if (this.On) {
187
+ payload.command = 'turnOn';
188
+ }
189
+ else {
190
+ payload.command = 'turnOff';
191
+ }
192
+ this.infoLog(`Strip Light: ${this.accessory.displayName} Sending request to SwitchBot API. command: ${payload.command},` +
193
+ ` parameter: ${payload.parameter}, commandType: ${payload.commandType}`);
194
+ // Make the API request
195
+ const push = await this.platform.axios.post(`${settings_1.DeviceURL}/${this.device.deviceId}/commands`, payload);
196
+ this.debugLog(`Strip Light: ${this.accessory.displayName} pushChanges: ${JSON.stringify(push.data)}`);
197
+ this.statusCode(push);
198
+ this.OnCached = this.On;
199
+ this.accessory.context.On = this.OnCached;
200
+ }
201
+ // Push Brightness Update
202
+ if (this.On) {
203
+ await this.pushBrightnessChanges();
204
+ }
205
+ // Push Hue & Saturation Update
206
+ if (this.On) {
207
+ await this.pushHueSaturationChanges();
208
+ }
209
+ }
210
+ catch (e) {
211
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection`);
212
+ if (this.deviceLogging.includes('debug')) {
213
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,` +
214
+ ` Error Message: ${JSON.stringify(e.message)}`);
215
+ }
216
+ this.apiError(e);
217
+ }
218
+ }
219
+ async pushHueSaturationChanges() {
220
+ try {
221
+ if (this.Hue !== this.HueCached || this.Saturation !== this.SaturationCached) {
222
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Hue: ${JSON.stringify(this.Hue)}`);
223
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Saturation: ${JSON.stringify(this.Saturation)}`);
224
+ const [red, green, blue] = (0, settings_1.hs2rgb)(Number(this.Hue), Number(this.Saturation));
225
+ this.debugLog(`Strip Light: ${this.accessory.displayName} rgb: ${JSON.stringify([red, green, blue])}`);
226
+ const payload = {
227
+ commandType: 'command',
228
+ command: 'setColor',
229
+ parameter: `${red}:${green}:${blue}`,
230
+ };
231
+ this.infoLog(`Strip Light: ${this.accessory.displayName} Sending request to SwitchBot API. command: ${payload.command},` +
232
+ ` parameter: ${payload.parameter}, commandType: ${payload.commandType}`);
233
+ // Make the API request
234
+ const push = await this.platform.axios.post(`${settings_1.DeviceURL}/${this.device.deviceId}/commands`, payload);
235
+ this.debugLog(`Strip Light: ${this.accessory.displayName} pushChanges: ${JSON.stringify(push.data)}`);
236
+ this.statusCode(push);
237
+ this.HueCached = this.Hue;
238
+ this.SaturationCached = this.Saturation;
239
+ }
240
+ else {
241
+ this.debugLog(`Strip Light: ${this.accessory.displayName} No Changes.` +
242
+ `Hue: ${this.Hue}, HueCached: ${this.HueCached}, Saturation: ${this.Saturation}, SaturationCached: ${this.SaturationCached}`);
243
+ }
244
+ }
245
+ catch (e) {
246
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection`);
247
+ if (this.deviceLogging.includes('debug')) {
248
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,` +
249
+ ` Error Message: ${JSON.stringify(e.message)}`);
250
+ }
251
+ this.apiError(e);
252
+ }
253
+ }
254
+ async pushBrightnessChanges() {
255
+ try {
256
+ if (this.Brightness !== this.BrightnessCached) {
257
+ const payload = {
258
+ commandType: 'command',
259
+ command: 'setBrightness',
260
+ parameter: `${this.Brightness}`,
261
+ };
262
+ this.infoLog(`Strip Light: ${this.accessory.displayName} Sending request to SwitchBot API. command: ${payload.command},` +
263
+ ` parameter: ${payload.parameter}, commandType: ${payload.commandType}`);
264
+ // Make the API request
265
+ const push = await this.platform.axios.post(`${settings_1.DeviceURL}/${this.device.deviceId}/commands`, payload);
266
+ this.debugLog(`Strip Light: ${this.accessory.displayName} pushChanges: ${JSON.stringify(push.data)}`);
267
+ this.statusCode(push);
268
+ this.BrightnessCached = this.Brightness;
269
+ }
270
+ else {
271
+ this.debugLog(`Strip Light: ${this.accessory.displayName} No Changes.` +
272
+ `Brightness: ${this.Brightness}, BrightnessCached: ${this.BrightnessCached}`);
273
+ }
274
+ }
275
+ catch (e) {
276
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection`);
277
+ if (this.deviceLogging.includes('debug')) {
278
+ this.errorLog(`Strip Light: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,` +
279
+ ` Error Message: ${JSON.stringify(e.message)}`);
280
+ }
281
+ this.apiError(e);
282
+ }
283
+ }
284
+ async updateHomeKitCharacteristics() {
285
+ if (this.On === undefined) {
286
+ this.debugLog(`Strip Light: ${this.accessory.displayName} On: ${this.On}`);
287
+ }
288
+ else {
289
+ this.lightBulbService.updateCharacteristic(this.platform.Characteristic.On, this.On);
290
+ this.debugLog(`Strip Light: ${this.accessory.displayName} updateCharacteristic On: ${this.On}`);
291
+ }
292
+ if (this.Brightness === undefined) {
293
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Brightness: ${this.Brightness}`);
294
+ }
295
+ else {
296
+ this.lightBulbService.updateCharacteristic(this.platform.Characteristic.Brightness, this.Brightness);
297
+ this.debugLog(`Strip Light: ${this.accessory.displayName} updateCharacteristic Brightness: ${this.Brightness}`);
298
+ }
299
+ if (this.Hue === undefined) {
300
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Hue: ${this.Hue}`);
301
+ }
302
+ else {
303
+ this.lightBulbService.updateCharacteristic(this.platform.Characteristic.Hue, this.Hue);
304
+ this.debugLog(`Strip Light: ${this.accessory.displayName} updateCharacteristic Hue: ${this.Hue}`);
305
+ }
306
+ if (this.Saturation === undefined) {
307
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Saturation: ${this.Saturation}`);
308
+ }
309
+ else {
310
+ this.lightBulbService.updateCharacteristic(this.platform.Characteristic.Saturation, this.Saturation);
311
+ this.debugLog(`Strip Light: ${this.accessory.displayName} updateCharacteristic Saturation: ${this.Saturation}`);
312
+ }
313
+ }
314
+ apiError(e) {
315
+ this.lightBulbService.updateCharacteristic(this.platform.Characteristic.On, e);
316
+ this.lightBulbService.updateCharacteristic(this.platform.Characteristic.Hue, e);
317
+ this.lightBulbService.updateCharacteristic(this.platform.Characteristic.Brightness, e);
318
+ this.lightBulbService.updateCharacteristic(this.platform.Characteristic.Saturation, e);
319
+ //throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
320
+ }
321
+ statusCode(push) {
322
+ switch (push.data.statusCode) {
323
+ case 151:
324
+ this.errorLog(`Strip Light: ${this.accessory.displayName} Command not supported by this device type.`);
325
+ break;
326
+ case 152:
327
+ this.errorLog(`Strip Light: ${this.accessory.displayName} Device not found.`);
328
+ break;
329
+ case 160:
330
+ this.errorLog(`Strip Light: ${this.accessory.displayName} Command is not supported.`);
331
+ break;
332
+ case 161:
333
+ this.errorLog(`Strip Light: ${this.accessory.displayName} Device is offline.`);
334
+ this.offlineOff();
335
+ break;
336
+ case 171:
337
+ this.errorLog(`Strip Light: ${this.accessory.displayName} is offline. Hub: ${this.device.hubDeviceId}`);
338
+ this.offlineOff();
339
+ break;
340
+ case 190:
341
+ this.errorLog(`Strip Light: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,` +
342
+ ` Or command: ${JSON.stringify(push.data)} format is invalid`);
343
+ break;
344
+ case 100:
345
+ if (this.platform.debugMode) {
346
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Command successfully sent.`);
347
+ }
348
+ break;
349
+ default:
350
+ if (this.platform.debugMode) {
351
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Unknown statusCode.`);
352
+ }
353
+ }
354
+ }
355
+ async offlineOff() {
356
+ if (this.device.offline) {
357
+ this.On = false;
358
+ this.lightBulbService.getCharacteristic(this.platform.Characteristic.On).updateValue(this.On);
359
+ }
360
+ }
361
+ /**
362
+ * Handle requests to set the value of the "On" characteristic
363
+ */
364
+ async OnSet(value) {
365
+ this.debugLog(`Strip Light: ${this.accessory.displayName} On: ${value}`);
366
+ this.On = value;
367
+ this.doColorBulbUpdate.next();
368
+ }
369
+ /**
370
+ * Handle requests to set the value of the "Brightness" characteristic
371
+ */
372
+ async BrightnessSet(value) {
373
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Brightness: ${value}`);
374
+ this.Brightness = value;
375
+ this.doColorBulbUpdate.next();
376
+ }
377
+ /**
378
+ * Handle requests to set the value of the "Hue" characteristic
379
+ */
380
+ async HueSet(value) {
381
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Hue: ${value}`);
382
+ this.Hue = value;
383
+ this.doColorBulbUpdate.next();
384
+ }
385
+ /**
386
+ * Handle requests to set the value of the "Saturation" characteristic
387
+ */
388
+ async SaturationSet(value) {
389
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Saturation: ${value}`);
390
+ this.Saturation = value;
391
+ this.doColorBulbUpdate.next();
392
+ }
393
+ async config(device) {
394
+ let config = {};
395
+ if (device.colorbulb) {
396
+ config = device.colorbulb;
397
+ }
398
+ if (device.ble) {
399
+ config['ble'] = device.ble;
400
+ }
401
+ if (device.logging !== undefined) {
402
+ config['logging'] = device.logging;
403
+ }
404
+ if (device.refreshRate !== undefined) {
405
+ config['refreshRate'] = device.refreshRate;
406
+ }
407
+ if (device.scanDuration !== undefined) {
408
+ config['scanDuration'] = device.scanDuration;
409
+ }
410
+ if (device.offline !== undefined) {
411
+ config['offline'] = device.offline;
412
+ }
413
+ if (Object.entries(config).length !== 0) {
414
+ this.infoLog(`Strip Light: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
415
+ }
416
+ }
417
+ async refreshRate(device) {
418
+ if (device.refreshRate) {
419
+ this.deviceRefreshRate = this.accessory.context.refreshRate = device.refreshRate;
420
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
421
+ }
422
+ else if (this.platform.config.options.refreshRate) {
423
+ this.deviceRefreshRate = this.accessory.context.refreshRate = this.platform.config.options.refreshRate;
424
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
425
+ }
426
+ }
427
+ async logs(device) {
428
+ if (this.platform.debugMode) {
429
+ this.deviceLogging = this.accessory.context.logging = 'debugMode';
430
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
431
+ }
432
+ else if (device.logging) {
433
+ this.deviceLogging = this.accessory.context.logging = device.logging;
434
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
435
+ }
436
+ else if (this.platform.config.options?.logging) {
437
+ this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
438
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
439
+ }
440
+ else {
441
+ this.deviceLogging = this.accessory.context.logging = 'standard';
442
+ this.debugLog(`Strip Light: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
443
+ }
444
+ }
445
+ minStep(device) {
446
+ if (device.colorbulb?.set_minStep) {
447
+ this.set_minStep = device.colorbulb?.set_minStep;
448
+ }
449
+ else {
450
+ this.set_minStep = 1;
451
+ }
452
+ return this.set_minStep;
453
+ }
454
+ /**
455
+ * Logging for Device
456
+ */
457
+ infoLog(...log) {
458
+ if (this.enablingDeviceLogging()) {
459
+ this.platform.log.info(String(...log));
460
+ }
461
+ }
462
+ warnLog(...log) {
463
+ if (this.enablingDeviceLogging()) {
464
+ this.platform.log.warn(String(...log));
465
+ }
466
+ }
467
+ errorLog(...log) {
468
+ if (this.enablingDeviceLogging()) {
469
+ this.platform.log.error(String(...log));
470
+ }
471
+ }
472
+ debugLog(...log) {
473
+ if (this.enablingDeviceLogging()) {
474
+ if (this.deviceLogging === 'debug') {
475
+ this.platform.log.info('[DEBUG]', String(...log));
476
+ }
477
+ else {
478
+ this.platform.log.debug(String(...log));
479
+ }
480
+ }
481
+ }
482
+ enablingDeviceLogging() {
483
+ return this.deviceLogging.includes('debug') || this.deviceLogging === 'standard';
484
+ }
485
+ }
486
+ exports.StripLight = StripLight;
487
+ //# sourceMappingURL=striplight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"striplight.js","source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AAC,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;SACxC;IACH,CAAC;IAED,QAAQ,CAAC,GAAG,GAAU;QACpB,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE;YAChC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;SACzC;IACH,CAAC;IAED,QAAQ,CAAC,GAAG,GAAU;QACpB,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE;YAChC,IAAI,IAAI,CAAC,aAAa,KAAK,OAAO,EAAE;gBAClC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;aACnD;iBAAM;gBACL,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;aACzC;SACF;IACH,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,aAAa,KAAK,UAAU,CAAC;IACnF,CAAC;CACF;AA1jBD,gCA0jBC"}
@@ -41,6 +41,7 @@ export declare class SwitchBotPlatform implements DynamicPlatformPlugin {
41
41
  private createHumidifier;
42
42
  private createBot;
43
43
  private createMeter;
44
+ private createMeterPlus;
44
45
  private createMotion;
45
46
  private createContact;
46
47
  private createCurtain;
@@ -48,6 +49,7 @@ export declare class SwitchBotPlatform implements DynamicPlatformPlugin {
48
49
  private createPlug;
49
50
  private createLock;
50
51
  private createColorBulb;
52
+ private createStripLight;
51
53
  private createTV;
52
54
  private createFan;
53
55
  private createLight;
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAkBA,OAAc,EAAE,aAAa,EAAsB,MAAM,OAAO,CAAC;AAC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