@switchbot/homebridge-switchbot 3.5.0-beta.8 → 3.5.0
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/.vscode/settings.json +4 -1
- package/CHANGELOG.md +4 -1
- package/config.schema.json +170 -26
- package/dist/device/blindtilt.d.ts +21 -96
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +439 -817
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts +27 -72
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +835 -865
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +15 -69
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +287 -653
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts +15 -76
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +354 -732
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +14 -66
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +268 -576
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +18 -89
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +431 -851
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts +60 -0
- package/dist/device/device.d.ts.map +1 -0
- package/dist/device/device.js +739 -0
- package/dist/device/device.js.map +1 -0
- package/dist/device/fan.d.ts +63 -0
- package/dist/device/fan.d.ts.map +1 -0
- package/dist/device/fan.js +698 -0
- package/dist/device/fan.js.map +1 -0
- package/dist/device/hub.d.ts +15 -60
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +257 -631
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts +11 -66
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +266 -629
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts +12 -64
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +215 -615
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts +12 -70
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +336 -645
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts +17 -63
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +290 -595
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +15 -64
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +211 -608
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +15 -65
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +205 -615
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +12 -69
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +202 -563
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +10 -57
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +125 -484
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts +13 -63
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +233 -549
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts +11 -63
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +170 -493
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/homebridge-ui/public/index.html +22 -16
- package/dist/homebridge-ui/server.js +1 -1
- package/dist/homebridge-ui/server.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +10 -50
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +340 -468
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +8 -39
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +105 -319
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +7 -36
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +44 -285
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +7 -43
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +92 -350
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/irdevice.d.ts +40 -0
- package/dist/irdevice/irdevice.d.ts.map +1 -0
- package/dist/irdevice/irdevice.js +369 -0
- package/dist/irdevice/irdevice.js.map +1 -0
- package/dist/irdevice/light.d.ts +12 -45
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +118 -362
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +19 -48
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +438 -570
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +8 -40
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +91 -339
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +7 -36
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +45 -285
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +7 -36
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +47 -291
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +22 -8
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +342 -191
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +64 -17
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +16 -552
- package/dist/settings.js.map +1 -1
- package/dist/utils.d.ts +77 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +638 -1
- package/dist/utils.js.map +1 -1
- package/eslint.config.js +96 -0
- package/package.json +20 -16
- package/src/custom.d.ts +2 -1
- package/src/device/blindtilt.ts +472 -888
- package/src/device/bot.ts +893 -968
- package/src/device/ceilinglight.ts +304 -709
- package/src/device/colorbulb.ts +370 -803
- package/src/device/contact.ts +301 -611
- package/src/device/curtain.ts +460 -908
- package/src/device/device.ts +755 -0
- package/src/device/fan.ts +749 -0
- package/src/device/hub.ts +294 -664
- package/src/device/humidifier.ts +299 -696
- package/src/device/iosensor.ts +251 -644
- package/src/device/lightstrip.ts +362 -712
- package/src/device/lock.ts +328 -653
- package/src/device/meter.ts +247 -637
- package/src/device/meterplus.ts +240 -644
- package/src/device/motion.ts +230 -598
- package/src/device/plug.ts +139 -525
- package/src/device/robotvacuumcleaner.ts +258 -593
- package/src/device/waterdetector.ts +191 -522
- package/src/homebridge-ui/public/index.html +22 -16
- package/src/homebridge-ui/server.ts +1 -1
- package/src/index.ts +4 -3
- package/src/irdevice/airconditioner.ts +370 -527
- package/src/irdevice/airpurifier.ts +132 -356
- package/src/irdevice/camera.ts +58 -311
- package/src/irdevice/fan.ts +109 -379
- package/src/irdevice/irdevice.ts +382 -0
- package/src/irdevice/light.ts +157 -412
- package/src/irdevice/other.ts +507 -648
- package/src/irdevice/tv.ts +121 -375
- package/src/irdevice/vacuumcleaner.ts +59 -311
- package/src/irdevice/waterheater.ts +61 -320
- package/src/platform.ts +395 -259
- package/src/settings.ts +118 -609
- package/src/utils.ts +642 -1
- package/.github/npm-version-script.cjs +0 -81
- package/src/device/waterdetector.json +0 -11
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SwitchBotPlatform } from '../platform.js';
|
|
3
|
-
import { irDevicesConfig, irdevice
|
|
1
|
+
import { irdeviceBase } from './irdevice.js';
|
|
2
|
+
import type { SwitchBotPlatform } from '../platform.js';
|
|
3
|
+
import type { irDevicesConfig, irdevice } from '../settings.js';
|
|
4
|
+
import type { CharacteristicValue, PlatformAccessory } from 'homebridge';
|
|
4
5
|
/**
|
|
5
6
|
* Platform Accessory
|
|
6
7
|
* An instance of this class is created for each accessory your platform registers
|
|
7
8
|
* Each accessory may expose multiple services of different service types.
|
|
8
9
|
*/
|
|
9
|
-
export declare class Camera {
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
device: irdevice & irDevicesConfig;
|
|
13
|
-
readonly api: API;
|
|
14
|
-
readonly log: Logging;
|
|
15
|
-
readonly config: SwitchBotPlatformConfig;
|
|
16
|
-
protected readonly hap: HAP;
|
|
17
|
-
switchService: Service;
|
|
18
|
-
On: CharacteristicValue;
|
|
19
|
-
FirmwareRevision: CharacteristicValue;
|
|
20
|
-
deviceLogging: string;
|
|
21
|
-
disablePushOn?: boolean;
|
|
22
|
-
disablePushOff?: boolean;
|
|
10
|
+
export declare class Camera extends irdeviceBase {
|
|
11
|
+
readonly platform: SwitchBotPlatform;
|
|
12
|
+
private Switch;
|
|
23
13
|
constructor(platform: SwitchBotPlatform, accessory: PlatformAccessory, device: irdevice & irDevicesConfig);
|
|
24
14
|
OnSet(value: CharacteristicValue): Promise<void>;
|
|
25
15
|
/**
|
|
@@ -36,25 +26,6 @@ export declare class Camera {
|
|
|
36
26
|
pushOffChanges(): Promise<void>;
|
|
37
27
|
pushChanges(bodyChange: any): Promise<void>;
|
|
38
28
|
updateHomeKitCharacteristics(): Promise<void>;
|
|
39
|
-
disablePushOnChanges(device: irdevice & irDevicesConfig): Promise<void>;
|
|
40
|
-
disablePushOffChanges(device: irdevice & irDevicesConfig): Promise<void>;
|
|
41
|
-
commandType(): Promise<string>;
|
|
42
|
-
commandOn(): Promise<string>;
|
|
43
|
-
commandOff(): Promise<string>;
|
|
44
|
-
statusCode(statusCode: number): Promise<void>;
|
|
45
29
|
apiError(e: any): Promise<void>;
|
|
46
|
-
deviceContext(): Promise<void>;
|
|
47
|
-
deviceConfig(device: irdevice & irDevicesConfig): Promise<void>;
|
|
48
|
-
deviceLogs(device: irdevice & irDevicesConfig): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Logging for Device
|
|
51
|
-
*/
|
|
52
|
-
infoLog(...log: any[]): void;
|
|
53
|
-
warnLog(...log: any[]): void;
|
|
54
|
-
debugWarnLog(...log: any[]): void;
|
|
55
|
-
errorLog(...log: any[]): void;
|
|
56
|
-
debugErrorLog(...log: any[]): void;
|
|
57
|
-
debugLog(...log: any[]): void;
|
|
58
|
-
enablingDeviceLogging(): boolean;
|
|
59
30
|
}
|
|
60
31
|
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../src/irdevice/camera.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../src/irdevice/camera.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAW,MAAM,YAAY,CAAC;AAElF;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IASpC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB;IAPtC,OAAO,CAAC,MAAM,CAIZ;gBAGS,QAAQ,EAAE,iBAAiB,EACpC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,QAAQ,GAAG,eAAe;IAsB9B,KAAK,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWtD;;;;;;;;;OASG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAe9B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAe/B,WAAW,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC3C,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IAW7C,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtC"}
|
package/dist/irdevice/camera.js
CHANGED
|
@@ -1,64 +1,42 @@
|
|
|
1
|
+
/* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* camera.ts: @switchbot/homebridge-switchbot.
|
|
4
|
+
*/
|
|
1
5
|
import { request } from 'undici';
|
|
2
6
|
import { Devices } from '../settings.js';
|
|
7
|
+
import { irdeviceBase } from './irdevice.js';
|
|
3
8
|
/**
|
|
4
9
|
* Platform Accessory
|
|
5
10
|
* An instance of this class is created for each accessory your platform registers
|
|
6
11
|
* Each accessory may expose multiple services of different service types.
|
|
7
12
|
*/
|
|
8
|
-
export class Camera {
|
|
13
|
+
export class Camera extends irdeviceBase {
|
|
9
14
|
platform;
|
|
10
|
-
accessory;
|
|
11
|
-
device;
|
|
12
|
-
api;
|
|
13
|
-
log;
|
|
14
|
-
config;
|
|
15
|
-
hap;
|
|
16
15
|
// Services
|
|
17
|
-
|
|
18
|
-
// Characteristic Values
|
|
19
|
-
On;
|
|
20
|
-
FirmwareRevision;
|
|
21
|
-
// Config
|
|
22
|
-
deviceLogging;
|
|
23
|
-
disablePushOn;
|
|
24
|
-
disablePushOff;
|
|
16
|
+
Switch;
|
|
25
17
|
constructor(platform, accessory, device) {
|
|
18
|
+
super(platform, accessory, device);
|
|
26
19
|
this.platform = platform;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.
|
|
42
|
-
.setCharacteristic(this.hap.Characteristic.Manufacturer, 'SwitchBot')
|
|
43
|
-
.setCharacteristic(this.hap.Characteristic.Model, device.remoteType)
|
|
44
|
-
.setCharacteristic(this.hap.Characteristic.SerialNumber, device.deviceId)
|
|
45
|
-
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision);
|
|
46
|
-
// get the Television service if it exists, otherwise create a new Television service
|
|
47
|
-
// you can create multiple services for each accessory
|
|
48
|
-
const switchService = `${accessory.displayName} Camera`;
|
|
49
|
-
(this.switchService = accessory.getService(this.hap.Service.Switch)
|
|
50
|
-
|| accessory.addService(this.hap.Service.Switch)), switchService;
|
|
51
|
-
this.switchService.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName);
|
|
52
|
-
if (!this.switchService.testCharacteristic(this.hap.Characteristic.ConfiguredName)) {
|
|
53
|
-
this.switchService.addCharacteristic(this.hap.Characteristic.ConfiguredName, accessory.displayName);
|
|
54
|
-
}
|
|
55
|
-
// handle on / off events using the On characteristic
|
|
56
|
-
this.switchService.getCharacteristic(this.hap.Characteristic.On).onSet(this.OnSet.bind(this));
|
|
20
|
+
// Initialize Switch Service
|
|
21
|
+
accessory.context.Switch = accessory.context.Switch ?? {};
|
|
22
|
+
this.Switch = {
|
|
23
|
+
Name: accessory.context.Switch.Name ?? `${accessory.displayName} Camera`,
|
|
24
|
+
Service: accessory.getService(this.hap.Service.Switch) ?? accessory.addService(this.hap.Service.Switch),
|
|
25
|
+
On: accessory.context.On ?? false,
|
|
26
|
+
};
|
|
27
|
+
accessory.context.Switch = this.Switch;
|
|
28
|
+
this.Switch.Service
|
|
29
|
+
.setCharacteristic(this.hap.Characteristic.Name, this.Switch.Name)
|
|
30
|
+
.getCharacteristic(this.hap.Characteristic.On)
|
|
31
|
+
.onGet(() => {
|
|
32
|
+
return this.Switch.On;
|
|
33
|
+
})
|
|
34
|
+
.onSet(this.OnSet.bind(this));
|
|
57
35
|
}
|
|
58
36
|
async OnSet(value) {
|
|
59
37
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${value}`);
|
|
60
|
-
this.On = value;
|
|
61
|
-
if (this.On) {
|
|
38
|
+
this.Switch.On = value;
|
|
39
|
+
if (this.Switch.On) {
|
|
62
40
|
this.pushOnChanges();
|
|
63
41
|
}
|
|
64
42
|
else {
|
|
@@ -76,8 +54,9 @@ export class Camera {
|
|
|
76
54
|
* Camera - "command" "channelSub" "default" = previous channel
|
|
77
55
|
*/
|
|
78
56
|
async pushOnChanges() {
|
|
79
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushOnChanges On: ${this.On},`
|
|
80
|
-
|
|
57
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushOnChanges On: ${this.Switch.On},`
|
|
58
|
+
+ ` disablePushOn: ${this.disablePushOn}`);
|
|
59
|
+
if (this.Switch.On && !this.disablePushOn) {
|
|
81
60
|
const commandType = await this.commandType();
|
|
82
61
|
const command = await this.commandOn();
|
|
83
62
|
const bodyChange = JSON.stringify({
|
|
@@ -89,8 +68,9 @@ export class Camera {
|
|
|
89
68
|
}
|
|
90
69
|
}
|
|
91
70
|
async pushOffChanges() {
|
|
92
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushOffChanges On: ${this.On},`
|
|
93
|
-
|
|
71
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushOffChanges On: ${this.Switch.On},`
|
|
72
|
+
+ ` disablePushOff: ${this.disablePushOff}`);
|
|
73
|
+
if (!this.Switch.On && !this.disablePushOff) {
|
|
94
74
|
const commandType = await this.commandType();
|
|
95
75
|
const command = await this.commandOff();
|
|
96
76
|
const bodyChange = JSON.stringify({
|
|
@@ -116,8 +96,10 @@ export class Camera {
|
|
|
116
96
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
117
97
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
118
98
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
119
|
-
this.
|
|
99
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
120
100
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
101
|
+
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
102
|
+
+ ` request to SwitchBot API, body: ${JSON.stringify(JSON.parse(bodyChange))} sent successfully`);
|
|
121
103
|
this.updateHomeKitCharacteristics();
|
|
122
104
|
}
|
|
123
105
|
else {
|
|
@@ -127,251 +109,28 @@ export class Camera {
|
|
|
127
109
|
}
|
|
128
110
|
catch (e) {
|
|
129
111
|
this.apiError(e);
|
|
130
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with ${this.device.connectionType}`
|
|
131
|
-
` Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
112
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with ${this.device.connectionType}`
|
|
113
|
+
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
132
114
|
}
|
|
133
115
|
}
|
|
134
116
|
else {
|
|
135
|
-
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
136
|
-
` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
117
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
118
|
+
+ ` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
137
119
|
}
|
|
138
120
|
}
|
|
139
121
|
async updateHomeKitCharacteristics() {
|
|
140
122
|
// On
|
|
141
|
-
if (this.On === undefined) {
|
|
142
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.On}`);
|
|
123
|
+
if (this.Switch.On === undefined) {
|
|
124
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.Switch.On}`);
|
|
143
125
|
}
|
|
144
126
|
else {
|
|
145
|
-
this.accessory.context.On = this.On;
|
|
146
|
-
this.
|
|
147
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic On: ${this.On}`);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
async disablePushOnChanges(device) {
|
|
151
|
-
if (device.disablePushOn === undefined) {
|
|
152
|
-
this.disablePushOn = false;
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
this.disablePushOn = device.disablePushOn;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
async disablePushOffChanges(device) {
|
|
159
|
-
if (device.disablePushOff === undefined) {
|
|
160
|
-
this.disablePushOff = false;
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
this.disablePushOff = device.disablePushOff;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
async commandType() {
|
|
167
|
-
let commandType;
|
|
168
|
-
if (this.device.customize) {
|
|
169
|
-
commandType = 'customize';
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
commandType = 'command';
|
|
173
|
-
}
|
|
174
|
-
return commandType;
|
|
175
|
-
}
|
|
176
|
-
async commandOn() {
|
|
177
|
-
let command;
|
|
178
|
-
if (this.device.customize && this.device.customOn) {
|
|
179
|
-
command = this.device.customOn;
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
command = 'turnOn';
|
|
183
|
-
}
|
|
184
|
-
return command;
|
|
185
|
-
}
|
|
186
|
-
async commandOff() {
|
|
187
|
-
let command;
|
|
188
|
-
if (this.device.customize && this.device.customOff) {
|
|
189
|
-
command = this.device.customOff;
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
command = 'turnOff';
|
|
193
|
-
}
|
|
194
|
-
return command;
|
|
195
|
-
}
|
|
196
|
-
async statusCode(statusCode) {
|
|
197
|
-
switch (statusCode) {
|
|
198
|
-
case 151:
|
|
199
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Command not supported by this deviceType, statusCode: ${statusCode}`);
|
|
200
|
-
break;
|
|
201
|
-
case 152:
|
|
202
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Device not found, statusCode: ${statusCode}`);
|
|
203
|
-
break;
|
|
204
|
-
case 160:
|
|
205
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Command is not supported, statusCode: ${statusCode}`);
|
|
206
|
-
break;
|
|
207
|
-
case 161:
|
|
208
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Device is offline, statusCode: ${statusCode}`);
|
|
209
|
-
break;
|
|
210
|
-
case 171:
|
|
211
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Hub Device is offline, statusCode: ${statusCode}. ` +
|
|
212
|
-
`Hub: ${this.device.hubDeviceId}`);
|
|
213
|
-
break;
|
|
214
|
-
case 190:
|
|
215
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,` +
|
|
216
|
-
` Or command format is invalid, statusCode: ${statusCode}`);
|
|
217
|
-
break;
|
|
218
|
-
case 100:
|
|
219
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Command successfully sent, statusCode: ${statusCode}`);
|
|
220
|
-
break;
|
|
221
|
-
case 200:
|
|
222
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
|
|
223
|
-
break;
|
|
224
|
-
case 400:
|
|
225
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
|
|
226
|
-
+ `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
|
|
227
|
-
break;
|
|
228
|
-
case 401:
|
|
229
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
|
|
230
|
-
+ `but the request has not been authenticated, statusCode: ${statusCode}`);
|
|
231
|
-
break;
|
|
232
|
-
case 403:
|
|
233
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
|
|
234
|
-
+ `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
|
|
235
|
-
break;
|
|
236
|
-
case 404:
|
|
237
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
|
|
238
|
-
+ `statusCode: ${statusCode}`);
|
|
239
|
-
break;
|
|
240
|
-
case 406:
|
|
241
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
|
|
242
|
-
+ `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
|
|
243
|
-
break;
|
|
244
|
-
case 415:
|
|
245
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
|
|
246
|
-
+ `header that is not supported by the server, statusCode: ${statusCode}`);
|
|
247
|
-
break;
|
|
248
|
-
case 422:
|
|
249
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
|
|
250
|
-
+ `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
|
|
251
|
-
break;
|
|
252
|
-
case 429:
|
|
253
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
|
|
254
|
-
+ `requests allowed for a given time window, statusCode: ${statusCode}`);
|
|
255
|
-
break;
|
|
256
|
-
case 500:
|
|
257
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
|
|
258
|
-
+ `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
|
|
259
|
-
break;
|
|
260
|
-
default:
|
|
261
|
-
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
|
|
262
|
-
`${statusCode}, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug`);
|
|
127
|
+
this.accessory.context.On = this.Switch.On;
|
|
128
|
+
this.Switch.Service.updateCharacteristic(this.hap.Characteristic.On, this.Switch.On);
|
|
129
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic On: ${this.Switch.On}`);
|
|
263
130
|
}
|
|
264
131
|
}
|
|
265
132
|
async apiError(e) {
|
|
266
|
-
this.
|
|
267
|
-
}
|
|
268
|
-
async deviceContext() {
|
|
269
|
-
if (this.On === undefined) {
|
|
270
|
-
this.On = false;
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
this.On = this.accessory.context.On;
|
|
274
|
-
}
|
|
275
|
-
if (this.FirmwareRevision === undefined) {
|
|
276
|
-
this.FirmwareRevision = this.platform.version;
|
|
277
|
-
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
async deviceConfig(device) {
|
|
281
|
-
let config = {};
|
|
282
|
-
if (device.ircam) {
|
|
283
|
-
config = device.ircam;
|
|
284
|
-
}
|
|
285
|
-
if (device.logging !== undefined) {
|
|
286
|
-
config['logging'] = device.logging;
|
|
287
|
-
}
|
|
288
|
-
if (device.connectionType !== undefined) {
|
|
289
|
-
config['connectionType'] = device.connectionType;
|
|
290
|
-
}
|
|
291
|
-
if (device.external !== undefined) {
|
|
292
|
-
config['external'] = device.external;
|
|
293
|
-
}
|
|
294
|
-
if (device.customOn !== undefined) {
|
|
295
|
-
config['customOn'] = device.customOn;
|
|
296
|
-
}
|
|
297
|
-
if (device.customOff !== undefined) {
|
|
298
|
-
config['customOff'] = device.customOff;
|
|
299
|
-
}
|
|
300
|
-
if (device.customize !== undefined) {
|
|
301
|
-
config['customize'] = device.customize;
|
|
302
|
-
}
|
|
303
|
-
if (device.disablePushOn !== undefined) {
|
|
304
|
-
config['disablePushOn'] = device.disablePushOn;
|
|
305
|
-
}
|
|
306
|
-
if (device.disablePushOff !== undefined) {
|
|
307
|
-
config['disablePushOff'] = device.disablePushOff;
|
|
308
|
-
}
|
|
309
|
-
if (Object.entries(config).length !== 0) {
|
|
310
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
async deviceLogs(device) {
|
|
314
|
-
if (this.platform.debugMode) {
|
|
315
|
-
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
316
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
317
|
-
}
|
|
318
|
-
else if (device.logging) {
|
|
319
|
-
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
320
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
321
|
-
}
|
|
322
|
-
else if (this.platform.config.options?.logging) {
|
|
323
|
-
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
324
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
328
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Logging for Device
|
|
333
|
-
*/
|
|
334
|
-
infoLog(...log) {
|
|
335
|
-
if (this.enablingDeviceLogging()) {
|
|
336
|
-
this.platform.log.info(String(...log));
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
warnLog(...log) {
|
|
340
|
-
if (this.enablingDeviceLogging()) {
|
|
341
|
-
this.platform.log.warn(String(...log));
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
debugWarnLog(...log) {
|
|
345
|
-
if (this.enablingDeviceLogging()) {
|
|
346
|
-
if (this.deviceLogging?.includes('debug')) {
|
|
347
|
-
this.platform.log.warn('[DEBUG]', String(...log));
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
errorLog(...log) {
|
|
352
|
-
if (this.enablingDeviceLogging()) {
|
|
353
|
-
this.platform.log.error(String(...log));
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
debugErrorLog(...log) {
|
|
357
|
-
if (this.enablingDeviceLogging()) {
|
|
358
|
-
if (this.deviceLogging?.includes('debug')) {
|
|
359
|
-
this.platform.log.error('[DEBUG]', String(...log));
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
debugLog(...log) {
|
|
364
|
-
if (this.enablingDeviceLogging()) {
|
|
365
|
-
if (this.deviceLogging === 'debug') {
|
|
366
|
-
this.platform.log.info('[DEBUG]', String(...log));
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
369
|
-
this.platform.log.debug(String(...log));
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
enablingDeviceLogging() {
|
|
374
|
-
return this.deviceLogging.includes('debug') || this.deviceLogging === 'standard';
|
|
133
|
+
this.Switch.Service.updateCharacteristic(this.hap.Characteristic.On, e);
|
|
375
134
|
}
|
|
376
135
|
}
|
|
377
136
|
//# sourceMappingURL=camera.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../../src/irdevice/camera.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAsD,MAAM,gBAAgB,CAAC;AAE7F;;;;GAIG;AACH,MAAM,OAAO,MAAM;IAkB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CAAC,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC,SAAS,CAAC,WAAW,QAAQ,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAClG,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACrF,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC,SAAS,CAAC,WAAW,6BAA6B,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QACvH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,CAAM;QACnB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF"}
|
package/dist/irdevice/fan.d.ts
CHANGED
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SwitchBotPlatform } from '../platform.js';
|
|
3
|
-
import { irDevicesConfig, irdevice
|
|
1
|
+
import { irdeviceBase } from './irdevice.js';
|
|
2
|
+
import type { SwitchBotPlatform } from '../platform.js';
|
|
3
|
+
import type { irDevicesConfig, irdevice } from '../settings.js';
|
|
4
|
+
import type { CharacteristicValue, PlatformAccessory } from 'homebridge';
|
|
4
5
|
/**
|
|
5
6
|
* Platform Accessory
|
|
6
7
|
* An instance of this class is created for each accessory your platform registers
|
|
7
8
|
* Each accessory may expose multiple services of different service types.
|
|
8
9
|
*/
|
|
9
|
-
export declare class
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
device: irdevice & irDevicesConfig;
|
|
13
|
-
readonly api: API;
|
|
14
|
-
readonly log: Logging;
|
|
15
|
-
readonly config: SwitchBotPlatformConfig;
|
|
16
|
-
protected readonly hap: HAP;
|
|
17
|
-
fanService: Service;
|
|
18
|
-
Active: CharacteristicValue;
|
|
19
|
-
SwingMode: CharacteristicValue;
|
|
20
|
-
RotationSpeed: CharacteristicValue;
|
|
21
|
-
FirmwareRevision: CharacteristicValue;
|
|
22
|
-
ActiveIdentifier: CharacteristicValue;
|
|
23
|
-
RotationDirection: CharacteristicValue;
|
|
24
|
-
minStep?: number;
|
|
25
|
-
minValue?: number;
|
|
26
|
-
maxValue?: number;
|
|
27
|
-
deviceLogging: string;
|
|
28
|
-
disablePushOn?: boolean;
|
|
29
|
-
disablePushOff?: boolean;
|
|
10
|
+
export declare class IRFan extends irdeviceBase {
|
|
11
|
+
readonly platform: SwitchBotPlatform;
|
|
12
|
+
private Fan;
|
|
30
13
|
constructor(platform: SwitchBotPlatform, accessory: PlatformAccessory, device: irdevice & irDevicesConfig);
|
|
31
14
|
SwingModeSet(value: CharacteristicValue): Promise<void>;
|
|
32
15
|
RotationSpeedSet(value: CharacteristicValue): Promise<void>;
|
|
@@ -47,25 +30,6 @@ export declare class Fan {
|
|
|
47
30
|
pushFanSwingChanges(): Promise<void>;
|
|
48
31
|
pushChanges(bodyChange: any): Promise<void>;
|
|
49
32
|
updateHomeKitCharacteristics(): Promise<void>;
|
|
50
|
-
disablePushOnChanges(device: irdevice & irDevicesConfig): Promise<void>;
|
|
51
|
-
disablePushOffChanges(device: irdevice & irDevicesConfig): Promise<void>;
|
|
52
|
-
commandType(): Promise<string>;
|
|
53
|
-
commandOn(): Promise<string>;
|
|
54
|
-
commandOff(): Promise<string>;
|
|
55
|
-
statusCode(statusCode: number): Promise<void>;
|
|
56
33
|
apiError(e: any): Promise<void>;
|
|
57
|
-
deviceContext(): Promise<void>;
|
|
58
|
-
deviceConfig(device: irdevice & irDevicesConfig): Promise<void>;
|
|
59
|
-
deviceLogs(device: irdevice & irDevicesConfig): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Logging for Device
|
|
62
|
-
*/
|
|
63
|
-
infoLog(...log: any[]): void;
|
|
64
|
-
warnLog(...log: any[]): void;
|
|
65
|
-
debugWarnLog(...log: any[]): void;
|
|
66
|
-
errorLog(...log: any[]): void;
|
|
67
|
-
debugErrorLog(...log: any[]): void;
|
|
68
|
-
debugLog(...log: any[]): void;
|
|
69
|
-
enablingDeviceLogging(): boolean;
|
|
70
34
|
}
|
|
71
35
|
//# sourceMappingURL=fan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fan.d.ts","sourceRoot":"","sources":["../../src/irdevice/fan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fan.d.ts","sourceRoot":"","sources":["../../src/irdevice/fan.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAW,MAAM,YAAY,CAAC;AAElF;;;;GAIG;AACH,qBAAa,KAAM,SAAQ,YAAY;IAYnC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB;IAVtC,OAAO,CAAC,GAAG,CAOT;gBAGS,QAAQ,EAAE,iBAAiB,EACpC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,QAAQ,GAAG,eAAe;IAgE9B,YAAY,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAevD,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAc3D,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;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