@switchbot/homebridge-switchbot 3.5.0-beta.9 → 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 +166 -24
- 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,72 +1,49 @@
|
|
|
1
|
+
/* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* waterheater.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 WaterHeater {
|
|
13
|
+
export class WaterHeater 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
|
-
Active;
|
|
20
|
-
FirmwareRevision;
|
|
21
|
-
// Config
|
|
22
|
-
deviceLogging;
|
|
23
|
-
disablePushOn;
|
|
24
|
-
disablePushOff;
|
|
16
|
+
Valve;
|
|
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
|
-
.
|
|
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 valveService = `${accessory.displayName} ${device.remoteType}`;
|
|
49
|
-
(this.valveService = accessory.getService(this.hap.Service.Valve)
|
|
50
|
-
|| accessory.addService(this.hap.Service.Valve)), valveService;
|
|
51
|
-
this.valveService.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName);
|
|
52
|
-
if (!this.valveService.testCharacteristic(this.hap.Characteristic.ConfiguredName)) {
|
|
53
|
-
this.valveService.addCharacteristic(this.hap.Characteristic.ConfiguredName, accessory.displayName);
|
|
54
|
-
}
|
|
55
|
-
// set sleep discovery characteristic
|
|
56
|
-
this.valveService.setCharacteristic(this.hap.Characteristic.ValveType, this.hap.Characteristic.ValveType.GENERIC_VALVE);
|
|
57
|
-
// handle on / off events using the Active characteristic
|
|
58
|
-
this.valveService.getCharacteristic(this.hap.Characteristic.Active).onSet(this.ActiveSet.bind(this));
|
|
20
|
+
// Initialize Switch Service
|
|
21
|
+
accessory.context.Valve = accessory.context.Valve ?? {};
|
|
22
|
+
this.Valve = {
|
|
23
|
+
Name: accessory.context.Valve.Name ?? `${accessory.displayName} ${device.remoteType}`,
|
|
24
|
+
Service: accessory.getService(this.hap.Service.Valve) ?? accessory.addService(this.hap.Service.Valve),
|
|
25
|
+
Active: accessory.context.Active ?? this.hap.Characteristic.Active.INACTIVE,
|
|
26
|
+
};
|
|
27
|
+
accessory.context.Valve = this.Valve;
|
|
28
|
+
this.Valve.Service
|
|
29
|
+
.setCharacteristic(this.hap.Characteristic.Name, accessory.displayName)
|
|
30
|
+
.setCharacteristic(this.hap.Characteristic.ValveType, this.hap.Characteristic.ValveType.GENERIC_VALVE)
|
|
31
|
+
.getCharacteristic(this.hap.Characteristic.Active)
|
|
32
|
+
.onGet(() => {
|
|
33
|
+
return this.Valve.Active;
|
|
34
|
+
})
|
|
35
|
+
.onSet(this.ActiveSet.bind(this));
|
|
59
36
|
}
|
|
60
37
|
async ActiveSet(value) {
|
|
61
38
|
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${value}`);
|
|
62
|
-
this.Active = value;
|
|
63
|
-
if (this.Active === this.hap.Characteristic.Active.ACTIVE) {
|
|
39
|
+
this.Valve.Active = value;
|
|
40
|
+
if (this.Valve.Active === this.hap.Characteristic.Active.ACTIVE) {
|
|
64
41
|
await this.pushWaterHeaterOnChanges();
|
|
65
|
-
this.
|
|
42
|
+
this.Valve.Service.setCharacteristic(this.hap.Characteristic.InUse, this.hap.Characteristic.InUse.IN_USE);
|
|
66
43
|
}
|
|
67
44
|
else {
|
|
68
45
|
await this.pushWaterHeaterOffChanges();
|
|
69
|
-
this.
|
|
46
|
+
this.Valve.Service.setCharacteristic(this.hap.Characteristic.InUse, this.hap.Characteristic.InUse.NOT_IN_USE);
|
|
70
47
|
}
|
|
71
48
|
}
|
|
72
49
|
/**
|
|
@@ -76,9 +53,9 @@ export class WaterHeater {
|
|
|
76
53
|
* WaterHeater "command" "turnOn" "default" set to ON state
|
|
77
54
|
*/
|
|
78
55
|
async pushWaterHeaterOnChanges() {
|
|
79
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushWaterHeaterOnChanges Active: ${this.Active},`
|
|
80
|
-
` disablePushOn: ${this.disablePushOn}`);
|
|
81
|
-
if (this.Active === this.hap.Characteristic.Active.ACTIVE && !this.disablePushOn) {
|
|
56
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushWaterHeaterOnChanges Active: ${this.Valve.Active},`
|
|
57
|
+
+ ` disablePushOn: ${this.disablePushOn}`);
|
|
58
|
+
if (this.Valve.Active === this.hap.Characteristic.Active.ACTIVE && !this.disablePushOn) {
|
|
82
59
|
const commandType = await this.commandType();
|
|
83
60
|
const command = await this.commandOn();
|
|
84
61
|
const bodyChange = JSON.stringify({
|
|
@@ -90,9 +67,9 @@ export class WaterHeater {
|
|
|
90
67
|
}
|
|
91
68
|
}
|
|
92
69
|
async pushWaterHeaterOffChanges() {
|
|
93
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushWaterHeaterOffChanges Active: ${this.Active},`
|
|
94
|
-
` disablePushOff: ${this.disablePushOff}`);
|
|
95
|
-
if (this.Active === this.hap.Characteristic.Active.INACTIVE && !this.disablePushOff) {
|
|
70
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushWaterHeaterOffChanges Active: ${this.Valve.Active},`
|
|
71
|
+
+ ` disablePushOff: ${this.disablePushOff}`);
|
|
72
|
+
if (this.Valve.Active === this.hap.Characteristic.Active.INACTIVE && !this.disablePushOff) {
|
|
96
73
|
const commandType = await this.commandType();
|
|
97
74
|
const command = await this.commandOff();
|
|
98
75
|
const bodyChange = JSON.stringify({
|
|
@@ -118,8 +95,10 @@ export class WaterHeater {
|
|
|
118
95
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
119
96
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
120
97
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
121
|
-
this.
|
|
98
|
+
this.debugSuccessLog(`${this.device.remoteType}: ${this.accessory.displayName} `
|
|
122
99
|
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
100
|
+
this.successLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
101
|
+
+ ` request to SwitchBot API, body: ${JSON.stringify(JSON.parse(bodyChange))} sent successfully`);
|
|
123
102
|
this.updateHomeKitCharacteristics();
|
|
124
103
|
}
|
|
125
104
|
else {
|
|
@@ -129,251 +108,28 @@ export class WaterHeater {
|
|
|
129
108
|
}
|
|
130
109
|
catch (e) {
|
|
131
110
|
this.apiError(e);
|
|
132
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with ${this.device.connectionType}`
|
|
133
|
-
` Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
111
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with ${this.device.connectionType}`
|
|
112
|
+
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`);
|
|
134
113
|
}
|
|
135
114
|
}
|
|
136
115
|
else {
|
|
137
|
-
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
138
|
-
` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
116
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
117
|
+
+ ` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
139
118
|
}
|
|
140
119
|
}
|
|
141
120
|
async updateHomeKitCharacteristics() {
|
|
142
121
|
// Active
|
|
143
|
-
if (this.Active === undefined) {
|
|
144
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${this.Active}`);
|
|
122
|
+
if (this.Valve.Active === undefined) {
|
|
123
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${this.Valve.Active}`);
|
|
145
124
|
}
|
|
146
125
|
else {
|
|
147
|
-
this.accessory.context.Active = this.Active;
|
|
148
|
-
this.
|
|
149
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Active}`);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
async disablePushOnChanges(device) {
|
|
153
|
-
if (device.disablePushOn === undefined) {
|
|
154
|
-
this.disablePushOn = false;
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
this.disablePushOn = device.disablePushOn;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
async disablePushOffChanges(device) {
|
|
161
|
-
if (device.disablePushOff === undefined) {
|
|
162
|
-
this.disablePushOff = false;
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
this.disablePushOff = device.disablePushOff;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
async commandType() {
|
|
169
|
-
let commandType;
|
|
170
|
-
if (this.device.customize) {
|
|
171
|
-
commandType = 'customize';
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
commandType = 'command';
|
|
175
|
-
}
|
|
176
|
-
return commandType;
|
|
177
|
-
}
|
|
178
|
-
async commandOn() {
|
|
179
|
-
let command;
|
|
180
|
-
if (this.device.customize && this.device.customOn) {
|
|
181
|
-
command = this.device.customOn;
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
command = 'turnOn';
|
|
185
|
-
}
|
|
186
|
-
return command;
|
|
187
|
-
}
|
|
188
|
-
async commandOff() {
|
|
189
|
-
let command;
|
|
190
|
-
if (this.device.customize && this.device.customOff) {
|
|
191
|
-
command = this.device.customOff;
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
command = 'turnOff';
|
|
195
|
-
}
|
|
196
|
-
return command;
|
|
197
|
-
}
|
|
198
|
-
async statusCode(statusCode) {
|
|
199
|
-
switch (statusCode) {
|
|
200
|
-
case 151:
|
|
201
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Command not supported by this deviceType, statusCode: ${statusCode}`);
|
|
202
|
-
break;
|
|
203
|
-
case 152:
|
|
204
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Device not found, statusCode: ${statusCode}`);
|
|
205
|
-
break;
|
|
206
|
-
case 160:
|
|
207
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Command is not supported, statusCode: ${statusCode}`);
|
|
208
|
-
break;
|
|
209
|
-
case 161:
|
|
210
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Device is offline, statusCode: ${statusCode}`);
|
|
211
|
-
break;
|
|
212
|
-
case 171:
|
|
213
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Hub Device is offline, statusCode: ${statusCode}. ` +
|
|
214
|
-
`Hub: ${this.device.hubDeviceId}`);
|
|
215
|
-
break;
|
|
216
|
-
case 190:
|
|
217
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,` +
|
|
218
|
-
` Or command format is invalid, statusCode: ${statusCode}`);
|
|
219
|
-
break;
|
|
220
|
-
case 100:
|
|
221
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Command successfully sent, statusCode: ${statusCode}`);
|
|
222
|
-
break;
|
|
223
|
-
case 200:
|
|
224
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
|
|
225
|
-
break;
|
|
226
|
-
case 400:
|
|
227
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
|
|
228
|
-
+ `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
|
|
229
|
-
break;
|
|
230
|
-
case 401:
|
|
231
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
|
|
232
|
-
+ `but the request has not been authenticated, statusCode: ${statusCode}`);
|
|
233
|
-
break;
|
|
234
|
-
case 403:
|
|
235
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
|
|
236
|
-
+ `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
|
|
237
|
-
break;
|
|
238
|
-
case 404:
|
|
239
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
|
|
240
|
-
+ `statusCode: ${statusCode}`);
|
|
241
|
-
break;
|
|
242
|
-
case 406:
|
|
243
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
|
|
244
|
-
+ `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
|
|
245
|
-
break;
|
|
246
|
-
case 415:
|
|
247
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
|
|
248
|
-
+ `header that is not supported by the server, statusCode: ${statusCode}`);
|
|
249
|
-
break;
|
|
250
|
-
case 422:
|
|
251
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
|
|
252
|
-
+ `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
|
|
253
|
-
break;
|
|
254
|
-
case 429:
|
|
255
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
|
|
256
|
-
+ `requests allowed for a given time window, statusCode: ${statusCode}`);
|
|
257
|
-
break;
|
|
258
|
-
case 500:
|
|
259
|
-
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
|
|
260
|
-
+ `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
|
|
261
|
-
break;
|
|
262
|
-
default:
|
|
263
|
-
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
|
|
264
|
-
`${statusCode}, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug`);
|
|
126
|
+
this.accessory.context.Active = this.Valve.Active;
|
|
127
|
+
this.Valve.Service.updateCharacteristic(this.hap.Characteristic.Active, this.Valve.Active);
|
|
128
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Valve.Active}`);
|
|
265
129
|
}
|
|
266
130
|
}
|
|
267
131
|
async apiError({ e }) {
|
|
268
|
-
this.
|
|
269
|
-
}
|
|
270
|
-
async deviceContext() {
|
|
271
|
-
if (this.Active === undefined) {
|
|
272
|
-
this.Active = this.hap.Characteristic.Active.INACTIVE;
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
this.Active = this.accessory.context.Active;
|
|
276
|
-
}
|
|
277
|
-
if (this.FirmwareRevision === undefined) {
|
|
278
|
-
this.FirmwareRevision = this.platform.version;
|
|
279
|
-
this.accessory.context.FirmwareRevision = this.FirmwareRevision;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
async deviceConfig(device) {
|
|
283
|
-
let config = {};
|
|
284
|
-
if (device.irwh) {
|
|
285
|
-
config = device.irwh;
|
|
286
|
-
}
|
|
287
|
-
if (device.logging !== undefined) {
|
|
288
|
-
config['logging'] = device.logging;
|
|
289
|
-
}
|
|
290
|
-
if (device.connectionType !== undefined) {
|
|
291
|
-
config['connectionType'] = device.connectionType;
|
|
292
|
-
}
|
|
293
|
-
if (device.external !== undefined) {
|
|
294
|
-
config['external'] = device.external;
|
|
295
|
-
}
|
|
296
|
-
if (device.customOn !== undefined) {
|
|
297
|
-
config['customOn'] = device.customOn;
|
|
298
|
-
}
|
|
299
|
-
if (device.customOff !== undefined) {
|
|
300
|
-
config['customOff'] = device.customOff;
|
|
301
|
-
}
|
|
302
|
-
if (device.customize !== undefined) {
|
|
303
|
-
config['customize'] = device.customize;
|
|
304
|
-
}
|
|
305
|
-
if (device.disablePushOn !== undefined) {
|
|
306
|
-
config['disablePushOn'] = device.disablePushOn;
|
|
307
|
-
}
|
|
308
|
-
if (device.disablePushOff !== undefined) {
|
|
309
|
-
config['disablePushOff'] = device.disablePushOff;
|
|
310
|
-
}
|
|
311
|
-
if (Object.entries(config).length !== 0) {
|
|
312
|
-
this.debugWarnLog({ log: [`${this.device.remoteType}: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`] });
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
async deviceLogs(device) {
|
|
316
|
-
if (this.platform.debugMode) {
|
|
317
|
-
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
318
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
319
|
-
}
|
|
320
|
-
else if (device.logging) {
|
|
321
|
-
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
322
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
323
|
-
}
|
|
324
|
-
else if (this.platform.config.options?.logging) {
|
|
325
|
-
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
326
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
330
|
-
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Logging for Device
|
|
335
|
-
*/
|
|
336
|
-
infoLog(...log) {
|
|
337
|
-
if (this.enablingDeviceLogging()) {
|
|
338
|
-
this.platform.log.info(String(...log));
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
warnLog(...log) {
|
|
342
|
-
if (this.enablingDeviceLogging()) {
|
|
343
|
-
this.platform.log.warn(String(...log));
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
debugWarnLog(...log) {
|
|
347
|
-
if (this.enablingDeviceLogging()) {
|
|
348
|
-
if (this.deviceLogging?.includes('debug')) {
|
|
349
|
-
this.platform.log.warn('[DEBUG]', String(...log));
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
errorLog(...log) {
|
|
354
|
-
if (this.enablingDeviceLogging()) {
|
|
355
|
-
this.platform.log.error(String(...log));
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
debugErrorLog(...log) {
|
|
359
|
-
if (this.enablingDeviceLogging()) {
|
|
360
|
-
if (this.deviceLogging?.includes('debug')) {
|
|
361
|
-
this.platform.log.error('[DEBUG]', String(...log));
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
debugLog(...log) {
|
|
366
|
-
if (this.enablingDeviceLogging()) {
|
|
367
|
-
if (this.deviceLogging === 'debug') {
|
|
368
|
-
this.platform.log.info('[DEBUG]', String(...log));
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
this.platform.log.debug(String(...log));
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
enablingDeviceLogging() {
|
|
376
|
-
return this.deviceLogging.includes('debug') || this.deviceLogging === 'standard';
|
|
132
|
+
this.Valve.Service.updateCharacteristic(this.hap.Characteristic.Active, e);
|
|
377
133
|
}
|
|
378
134
|
}
|
|
379
135
|
//# sourceMappingURL=waterheater.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waterheater.js","sourceRoot":"","sources":["../../src/irdevice/waterheater.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAsD,MAAM,gBAAgB,CAAC;AAE7F;;;;GAIG;AACH,MAAM,OAAO,WAAW;IAkBH;IACT;IACD;IAnBO,GAAG,CAAM;IACT,GAAG,CAAU;IACb,MAAM,CAA2B;IAC9B,GAAG,CAAM;IAC5B,WAAW;IACX,YAAY,CAAW;IAEvB,wBAAwB;IACxB,MAAM,CAAuB;IAC7B,gBAAgB,CAAuB;IAEvC,SAAS;IACT,aAAa,CAAU;IACvB,aAAa,CAAW;IACxB,cAAc,CAAW;IAEzB,YACmB,QAA2B,EACpC,SAA4B,EAC7B,MAAkC;QAFxB,aAAQ,GAAR,QAAQ,CAAmB;QACpC,cAAS,GAAT,SAAS,CAAmB;QAC7B,WAAM,GAAN,MAAM,CAA4B;QAEzC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QACnC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QACxB,uBAAuB;QACvB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxB,IAAI,CAAC,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M,CAAC,UAAU,KAAK,IAAI,CAAC,SAAS,CAAC,WAAW,iCAAiC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAC9H,CAAC;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAc;QAC9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
package/dist/platform.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { UrlObject } from 'url';
|
|
4
|
+
import type { MqttClient } from 'mqtt';
|
|
5
|
+
import type { Dispatcher } from 'undici';
|
|
6
|
+
import type { Server } from 'http';
|
|
7
|
+
import type { API, DynamicPlatformPlugin, Logging, PlatformAccessory } from 'homebridge';
|
|
8
|
+
import type { device, SwitchBotPlatformConfig, devicesConfig, irDevicesConfig } from './settings.js';
|
|
6
9
|
/**
|
|
7
10
|
* HomebridgePlatform
|
|
8
11
|
* This class is the main constructor for your plugin, this is where you should
|
|
@@ -15,10 +18,12 @@ export declare class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
15
18
|
version: string;
|
|
16
19
|
Logging?: string;
|
|
17
20
|
debugMode: boolean;
|
|
21
|
+
maxRetries: number;
|
|
22
|
+
delayBetweenRetries: number;
|
|
18
23
|
platformConfig: SwitchBotPlatformConfig['options'];
|
|
19
24
|
platformLogging: SwitchBotPlatformConfig['logging'];
|
|
20
25
|
config: SwitchBotPlatformConfig;
|
|
21
|
-
webhookEventListener:
|
|
26
|
+
webhookEventListener: Server | null;
|
|
22
27
|
mqttClient: MqttClient | null;
|
|
23
28
|
readonly fakegatoAPI: any;
|
|
24
29
|
readonly eve: any;
|
|
@@ -80,9 +85,10 @@ export declare class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
80
85
|
private createColorBulb;
|
|
81
86
|
private createCeilingLight;
|
|
82
87
|
private createStripLight;
|
|
88
|
+
private createFan;
|
|
83
89
|
private createRobotVacuumCleaner;
|
|
84
90
|
private createTV;
|
|
85
|
-
private
|
|
91
|
+
private createIRFan;
|
|
86
92
|
private createLight;
|
|
87
93
|
private createAirConditioner;
|
|
88
94
|
private createAirPurifier;
|
|
@@ -98,15 +104,23 @@ export declare class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
98
104
|
externalAccessory(accessory: PlatformAccessory): Promise<void>;
|
|
99
105
|
unregisterPlatformAccessories(existingAccessory: PlatformAccessory): void;
|
|
100
106
|
statusCode(statusCode: number): Promise<void>;
|
|
107
|
+
retryRequest(deviceMaxRetries: number, deviceDelayBetweenRetries: number, url: string | URL | UrlObject, options?: {
|
|
108
|
+
dispatcher?: Dispatcher;
|
|
109
|
+
} & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>): Promise<{
|
|
110
|
+
body: any;
|
|
111
|
+
statusCode: number;
|
|
112
|
+
}>;
|
|
101
113
|
connectBLE(): Promise<any>;
|
|
102
114
|
getVersion(): Promise<void>;
|
|
103
|
-
|
|
104
|
-
|
|
115
|
+
getPlatformConfigSettings(): Promise<void>;
|
|
116
|
+
getPlatformLogSettings(): Promise<void>;
|
|
105
117
|
/**
|
|
106
118
|
* If device level logging is turned on, log to log.warn
|
|
107
119
|
* Otherwise send debug logs to log.debug
|
|
108
120
|
*/
|
|
109
121
|
infoLog(...log: any[]): void;
|
|
122
|
+
successLog(...log: any[]): void;
|
|
123
|
+
debugSuccessLog(...log: any[]): void;
|
|
110
124
|
warnLog(...log: any[]): void;
|
|
111
125
|
debugWarnLog(...log: any[]): void;
|
|
112
126
|
errorLog(...log: any[]): void;
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;AA6CA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,EAAmC,MAAM,MAAM,CAAC;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,qBAAqB,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,KAAK,EAAY,MAAM,EAAE,uBAAuB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE/G;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,qBAAqB;IACtD,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACxC,SAAgB,GAAG,EAAE,GAAG,CAAC;IACzB,SAAgB,GAAG,EAAE,OAAO,CAAC;IAE7B,OAAO,EAAG,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAG,OAAO,CAAC;IACpB,UAAU,EAAG,MAAM,CAAC;IACpB,mBAAmB,EAAG,MAAM,CAAC;IAC7B,cAAc,EAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACpD,eAAe,EAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACrD,MAAM,EAAG,uBAAuB,CAAC;IAEjC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC3C,UAAU,EAAE,UAAU,GAAG,IAAI,CAAQ;IAErC,SAAgB,WAAW,EAAE,GAAG,CAAC;IACjC,SAAgB,GAAG,EAAE,GAAG,CAAC;IACzB,SAAgB,mBAAmB,EAAE;QAA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