@switchbot/homebridge-switchbot 2.2.2-beta.12 → 2.2.2-beta.14
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/CHANGELOG.md +9 -0
- package/config.schema.json +0 -31
- package/dist/device/bot.js +2 -2
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.js +2 -2
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.js +2 -2
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.js +2 -2
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.js +2 -2
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.js +2 -2
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/meter.js +2 -2
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.js +2 -2
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.js +2 -2
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.js +2 -2
- package/dist/device/plug.js.map +1 -1
- package/dist/device/striplight.js +2 -2
- package/dist/device/striplight.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +16 -13
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/settings.d.ts +1 -16
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +1 -1
- package/src/device/bot.ts +2 -2
- package/src/device/ceilinglight.ts +2 -2
- package/src/device/colorbulb.ts +2 -2
- package/src/device/contact.ts +2 -2
- package/src/device/curtain.ts +2 -2
- package/src/device/humidifier.ts +2 -2
- package/src/device/meter.ts +2 -2
- package/src/device/meterplus.ts +2 -2
- package/src/device/motion.ts +2 -2
- package/src/device/plug.ts +2 -2
- package/src/device/striplight.ts +2 -2
- package/src/irdevice/tv.ts +12 -10
- package/src/settings.ts +1 -23
package/src/device/colorbulb.ts
CHANGED
|
@@ -392,7 +392,7 @@ export class ColorBulb {
|
|
|
392
392
|
if (this.serviceData) {
|
|
393
393
|
this.connected = true;
|
|
394
394
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
395
|
-
//await this.stopScanning({ switchbot });
|
|
395
|
+
//await this.stopScanning({ switchbot: { switchbot } });
|
|
396
396
|
} else {
|
|
397
397
|
this.connected = false;
|
|
398
398
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -403,7 +403,7 @@ export class ColorBulb {
|
|
|
403
403
|
})
|
|
404
404
|
.then(async () => {
|
|
405
405
|
// Stop to monitor
|
|
406
|
-
await this.stopScanning({ switchbot });
|
|
406
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
407
407
|
})
|
|
408
408
|
.catch(async (e: any) => {
|
|
409
409
|
this.apiError(e);
|
package/src/device/contact.ts
CHANGED
|
@@ -323,7 +323,7 @@ export class Contact {
|
|
|
323
323
|
if (this.serviceData) {
|
|
324
324
|
this.connected = true;
|
|
325
325
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
326
|
-
await this.stopScanning({ switchbot });
|
|
326
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
327
327
|
} else {
|
|
328
328
|
this.connected = false;
|
|
329
329
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -334,7 +334,7 @@ export class Contact {
|
|
|
334
334
|
})
|
|
335
335
|
.then(async () => {
|
|
336
336
|
// Stop to monitor
|
|
337
|
-
await this.stopScanning({ switchbot });
|
|
337
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
338
338
|
})
|
|
339
339
|
.catch(async (e: any) => {
|
|
340
340
|
this.apiError(e);
|
package/src/device/curtain.ts
CHANGED
|
@@ -441,7 +441,7 @@ export class Curtain {
|
|
|
441
441
|
if (this.serviceData) {
|
|
442
442
|
this.connected = true;
|
|
443
443
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
444
|
-
await this.stopScanning({ switchbot });
|
|
444
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
445
445
|
} else {
|
|
446
446
|
this.connected = false;
|
|
447
447
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -452,7 +452,7 @@ export class Curtain {
|
|
|
452
452
|
})
|
|
453
453
|
.then(async () => {
|
|
454
454
|
// Stop to monitor
|
|
455
|
-
await this.stopScanning({ switchbot });
|
|
455
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
456
456
|
})
|
|
457
457
|
.catch(async (e: any) => {
|
|
458
458
|
this.apiError(e);
|
package/src/device/humidifier.ts
CHANGED
|
@@ -331,7 +331,7 @@ export class Humidifier {
|
|
|
331
331
|
if (this.serviceData) {
|
|
332
332
|
this.connected = true;
|
|
333
333
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
334
|
-
await this.stopScanning({ switchbot });
|
|
334
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
335
335
|
} else {
|
|
336
336
|
this.connected = false;
|
|
337
337
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -342,7 +342,7 @@ export class Humidifier {
|
|
|
342
342
|
})
|
|
343
343
|
.then(async () => {
|
|
344
344
|
// Stop to monitor
|
|
345
|
-
await this.stopScanning({ switchbot });
|
|
345
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
346
346
|
})
|
|
347
347
|
.catch(async (e: any) => {
|
|
348
348
|
this.apiError(e);
|
package/src/device/meter.ts
CHANGED
|
@@ -291,7 +291,7 @@ export class Meter {
|
|
|
291
291
|
if (this.serviceData) {
|
|
292
292
|
this.connected = true;
|
|
293
293
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
294
|
-
await this.stopScanning({ switchbot });
|
|
294
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
295
295
|
} else {
|
|
296
296
|
this.connected = false;
|
|
297
297
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -302,7 +302,7 @@ export class Meter {
|
|
|
302
302
|
})
|
|
303
303
|
.then(async () => {
|
|
304
304
|
// Stop to monitor
|
|
305
|
-
await this.stopScanning({ switchbot });
|
|
305
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
306
306
|
})
|
|
307
307
|
.catch(async (e: any) => {
|
|
308
308
|
this.apiError(e);
|
package/src/device/meterplus.ts
CHANGED
|
@@ -291,7 +291,7 @@ export class MeterPlus {
|
|
|
291
291
|
if (this.serviceData) {
|
|
292
292
|
this.connected = true;
|
|
293
293
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
294
|
-
await this.stopScanning({ switchbot });
|
|
294
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
295
295
|
} else {
|
|
296
296
|
this.connected = false;
|
|
297
297
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -302,7 +302,7 @@ export class MeterPlus {
|
|
|
302
302
|
})
|
|
303
303
|
.then(async () => {
|
|
304
304
|
// Stop to monitor
|
|
305
|
-
await this.stopScanning({ switchbot });
|
|
305
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
306
306
|
})
|
|
307
307
|
.catch(async (e: any) => {
|
|
308
308
|
this.apiError(e);
|
package/src/device/motion.ts
CHANGED
|
@@ -277,7 +277,7 @@ export class Motion {
|
|
|
277
277
|
if (this.serviceData) {
|
|
278
278
|
this.connected = true;
|
|
279
279
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
280
|
-
await this.stopScanning({ switchbot });
|
|
280
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
281
281
|
} else {
|
|
282
282
|
this.connected = false;
|
|
283
283
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -288,7 +288,7 @@ export class Motion {
|
|
|
288
288
|
})
|
|
289
289
|
.then(async () => {
|
|
290
290
|
// Stop to monitor
|
|
291
|
-
await this.stopScanning({ switchbot });
|
|
291
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
292
292
|
})
|
|
293
293
|
.catch(async (e: any) => {
|
|
294
294
|
this.apiError(e);
|
package/src/device/plug.ts
CHANGED
|
@@ -221,7 +221,7 @@ export class Plug {
|
|
|
221
221
|
if (this.serviceData) {
|
|
222
222
|
this.connected = true;
|
|
223
223
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
224
|
-
await this.stopScanning({ switchbot });
|
|
224
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
225
225
|
} else {
|
|
226
226
|
this.connected = false;
|
|
227
227
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -232,7 +232,7 @@ export class Plug {
|
|
|
232
232
|
})
|
|
233
233
|
.then(async () => {
|
|
234
234
|
// Stop to monitor
|
|
235
|
-
await this.stopScanning({ switchbot });
|
|
235
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
236
236
|
})
|
|
237
237
|
.catch(async (e: any) => {
|
|
238
238
|
this.apiError(e);
|
package/src/device/striplight.ts
CHANGED
|
@@ -335,7 +335,7 @@ export class StripLight {
|
|
|
335
335
|
if (this.serviceData) {
|
|
336
336
|
this.connected = true;
|
|
337
337
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
338
|
-
await this.stopScanning({ switchbot });
|
|
338
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
339
339
|
} else {
|
|
340
340
|
this.connected = false;
|
|
341
341
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -346,7 +346,7 @@ export class StripLight {
|
|
|
346
346
|
})
|
|
347
347
|
.then(async () => {
|
|
348
348
|
// Stop to monitor
|
|
349
|
-
await this.stopScanning({ switchbot });
|
|
349
|
+
await this.stopScanning({ switchbot: { switchbot } });
|
|
350
350
|
})
|
|
351
351
|
.catch(async (e: any) => {
|
|
352
352
|
this.apiError(e);
|
package/src/irdevice/tv.ts
CHANGED
|
@@ -197,23 +197,20 @@ export class TV {
|
|
|
197
197
|
async ActiveIdentifierSet(value: CharacteristicValue): Promise<void> {
|
|
198
198
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} ActiveIdentifier: ${value}`);
|
|
199
199
|
this.ActiveIdentifier = value;
|
|
200
|
-
this.accessory.context.ActiveIdentifier = this.ActiveIdentifier;
|
|
201
200
|
}
|
|
202
201
|
|
|
203
202
|
async ActiveSet(value: CharacteristicValue): Promise<void> {
|
|
204
203
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${value}`);
|
|
205
|
-
if (
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
/**
|
|
204
|
+
if (value === this.platform.Characteristic.Active.ACTIVE) {
|
|
205
|
+
await this.pushTvOnChanges();
|
|
206
|
+
} else {
|
|
207
|
+
await this.pushTvOffChanges();
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
212
210
|
* pushTvOnChanges and pushTvOffChanges above assume they are measuring the state of the accessory BEFORE
|
|
213
211
|
* they are updated, so we are only updating the accessory state after calling the above.
|
|
214
212
|
*/
|
|
215
|
-
|
|
216
|
-
}
|
|
213
|
+
this.Active = value;
|
|
217
214
|
}
|
|
218
215
|
|
|
219
216
|
/**
|
|
@@ -514,6 +511,11 @@ export class TV {
|
|
|
514
511
|
} else {
|
|
515
512
|
this.Active = this.accessory.context.Active;
|
|
516
513
|
}
|
|
514
|
+
if (this.ActiveIdentifier === undefined) {
|
|
515
|
+
this.ActiveIdentifier = 1;
|
|
516
|
+
} else {
|
|
517
|
+
this.ActiveIdentifier = this.accessory.context.ActiveIdentifier;
|
|
518
|
+
}
|
|
517
519
|
}
|
|
518
520
|
|
|
519
521
|
async config(device: irdevice & irDevicesConfig): Promise<void> {
|
package/src/settings.ts
CHANGED
|
@@ -149,7 +149,7 @@ export interface irDevicesConfig extends irdevice {
|
|
|
149
149
|
irlight?: Record<any, any>;
|
|
150
150
|
irvc?: Record<any, any>;
|
|
151
151
|
irwh?: Record<any, any>;
|
|
152
|
-
irtv?:
|
|
152
|
+
irtv?: Record<any, any>;
|
|
153
153
|
other?: other;
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -161,32 +161,10 @@ export type irfan = {
|
|
|
161
161
|
set_min?: number; //set_min
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
-
//For Potential Future Use
|
|
165
|
-
export type set_minStep = {
|
|
166
|
-
set_minStep_device?: boolean;
|
|
167
|
-
set_minStep?: number;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
//For Potential Future Use
|
|
171
|
-
export type set_max = {
|
|
172
|
-
set_max_device?: boolean;
|
|
173
|
-
set_max?: number;
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
//For Potential Future Use
|
|
177
|
-
export type set_min = {
|
|
178
|
-
set_min_device?: boolean;
|
|
179
|
-
set_min?: number;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
164
|
export type irair = {
|
|
183
165
|
hide_automode?: boolean;
|
|
184
166
|
};
|
|
185
167
|
|
|
186
|
-
export type irtv = {
|
|
187
|
-
disable_power?: boolean;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
168
|
export type other = {
|
|
191
169
|
deviceType?: string;
|
|
192
170
|
};
|