@switchbot/homebridge-switchbot 3.5.1-beta.10 → 3.5.1-beta.12
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/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +6 -9
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +7 -3
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +1 -3
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +44 -103
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +0 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +18 -49
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +9 -9
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +19 -19
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/irdevice.d.ts +22 -10
- package/dist/irdevice/irdevice.d.ts.map +1 -1
- package/dist/irdevice/irdevice.js +89 -67
- package/dist/irdevice/irdevice.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +15 -17
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +76 -76
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +35 -35
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +9 -9
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +9 -9
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +202 -201
- package/dist/platform.js.map +1 -1
- package/package.json +1 -1
- package/src/device/ceilinglight.ts +6 -14
- package/src/device/colorbulb.ts +7 -10
- package/src/irdevice/airconditioner.ts +53 -97
- package/src/irdevice/airpurifier.ts +23 -45
- package/src/irdevice/camera.ts +9 -9
- package/src/irdevice/fan.ts +19 -19
- package/src/irdevice/irdevice.ts +92 -68
- package/src/irdevice/light.ts +15 -17
- package/src/irdevice/other.ts +76 -76
- package/src/irdevice/tv.ts +35 -35
- package/src/irdevice/vacuumcleaner.ts +9 -9
- package/src/irdevice/waterheater.ts +9 -9
- package/src/platform.ts +202 -201
package/src/irdevice/tv.ts
CHANGED
|
@@ -125,7 +125,7 @@ export class TV extends irdeviceBase {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
async VolumeSelectorSet(value: CharacteristicValue): Promise<void> {
|
|
128
|
-
this.debugLog(
|
|
128
|
+
await this.debugLog(`VolumeSelector: ${value}`);
|
|
129
129
|
if (value === this.hap.Characteristic.VolumeSelector.INCREMENT) {
|
|
130
130
|
this.pushVolumeUpChanges();
|
|
131
131
|
} else {
|
|
@@ -136,61 +136,61 @@ export class TV extends irdeviceBase {
|
|
|
136
136
|
async RemoteKeySet(value: CharacteristicValue): Promise<void> {
|
|
137
137
|
switch (value) {
|
|
138
138
|
case this.hap.Characteristic.RemoteKey.REWIND: {
|
|
139
|
-
this.debugLog(
|
|
139
|
+
await this.debugLog('Set Remote Key Pressed: REWIND');
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
142
|
case this.hap.Characteristic.RemoteKey.FAST_FORWARD: {
|
|
143
|
-
this.debugLog(
|
|
143
|
+
await this.debugLog('Set Remote Key Pressed: FAST_FORWARD');
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
case this.hap.Characteristic.RemoteKey.NEXT_TRACK: {
|
|
147
|
-
this.debugLog(
|
|
147
|
+
await this.debugLog('Set Remote Key Pressed: NEXT_TRACK');
|
|
148
148
|
break;
|
|
149
149
|
}
|
|
150
150
|
case this.hap.Characteristic.RemoteKey.PREVIOUS_TRACK: {
|
|
151
|
-
this.debugLog(
|
|
151
|
+
await this.debugLog('Set Remote Key Pressed: PREVIOUS_TRACK');
|
|
152
152
|
break;
|
|
153
153
|
}
|
|
154
154
|
case this.hap.Characteristic.RemoteKey.ARROW_UP: {
|
|
155
|
-
this.debugLog(
|
|
155
|
+
await this.debugLog('Set Remote Key Pressed: ARROW_UP');
|
|
156
156
|
//this.pushUpChanges();
|
|
157
157
|
break;
|
|
158
158
|
}
|
|
159
159
|
case this.hap.Characteristic.RemoteKey.ARROW_DOWN: {
|
|
160
|
-
this.debugLog(
|
|
160
|
+
await this.debugLog('Set Remote Key Pressed: ARROW_DOWN');
|
|
161
161
|
//this.pushDownChanges();
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
164
|
case this.hap.Characteristic.RemoteKey.ARROW_LEFT: {
|
|
165
|
-
this.debugLog(
|
|
165
|
+
await this.debugLog('Set Remote Key Pressed: ARROW_LEFT');
|
|
166
166
|
//this.pushLeftChanges();
|
|
167
167
|
break;
|
|
168
168
|
}
|
|
169
169
|
case this.hap.Characteristic.RemoteKey.ARROW_RIGHT: {
|
|
170
|
-
this.debugLog(
|
|
170
|
+
await this.debugLog('Set Remote Key Pressed: ARROW_RIGHT');
|
|
171
171
|
//this.pushRightChanges();
|
|
172
172
|
break;
|
|
173
173
|
}
|
|
174
174
|
case this.hap.Characteristic.RemoteKey.SELECT: {
|
|
175
|
-
this.debugLog(
|
|
175
|
+
await this.debugLog('Set Remote Key Pressed: SELECT');
|
|
176
176
|
//this.pushOkChanges();
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
case this.hap.Characteristic.RemoteKey.BACK: {
|
|
180
|
-
this.debugLog(
|
|
180
|
+
await this.debugLog('Set Remote Key Pressed: BACK');
|
|
181
181
|
//this.pushBackChanges();
|
|
182
182
|
break;
|
|
183
183
|
}
|
|
184
184
|
case this.hap.Characteristic.RemoteKey.EXIT: {
|
|
185
|
-
this.debugLog(
|
|
185
|
+
await this.debugLog('Set Remote Key Pressed: EXIT');
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
188
|
case this.hap.Characteristic.RemoteKey.PLAY_PAUSE: {
|
|
189
|
-
this.debugLog(
|
|
189
|
+
await this.debugLog('Set Remote Key Pressed: PLAY_PAUSE');
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
case this.hap.Characteristic.RemoteKey.INFORMATION: {
|
|
193
|
-
this.debugLog(
|
|
193
|
+
await this.debugLog('Set Remote Key Pressed: INFORMATION');
|
|
194
194
|
//this.pushMenuChanges();
|
|
195
195
|
break;
|
|
196
196
|
}
|
|
@@ -198,12 +198,12 @@ export class TV extends irdeviceBase {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
async ActiveIdentifierSet(value: CharacteristicValue): Promise<void> {
|
|
201
|
-
this.debugLog(
|
|
201
|
+
await this.debugLog(`ActiveIdentifier: ${value}`);
|
|
202
202
|
this.Television.ActiveIdentifier = value;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
async ActiveSet(value: CharacteristicValue): Promise<void> {
|
|
206
|
-
this.debugLog(
|
|
206
|
+
await this.debugLog(`Active (value): ${value}`);
|
|
207
207
|
|
|
208
208
|
this.Television.Active = value;
|
|
209
209
|
if (this.Television.Active === this.hap.Characteristic.Active.ACTIVE) {
|
|
@@ -224,7 +224,7 @@ export class TV extends irdeviceBase {
|
|
|
224
224
|
* TV "command" "channelSub" "default" previous channel
|
|
225
225
|
*/
|
|
226
226
|
async pushTvOnChanges(): Promise<void> {
|
|
227
|
-
this.debugLog(
|
|
227
|
+
await this.debugLog('pushTvOnChanges'
|
|
228
228
|
+ ` Active: ${this.Television.Active}, disablePushOn: ${this.disablePushOn}`);
|
|
229
229
|
if (this.Television.Active === this.hap.Characteristic.Active.ACTIVE && !this.disablePushOn) {
|
|
230
230
|
const commandType: string = await this.commandType();
|
|
@@ -239,7 +239,7 @@ export class TV extends irdeviceBase {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
async pushTvOffChanges(): Promise<void> {
|
|
242
|
-
this.debugLog(
|
|
242
|
+
await this.debugLog('pushTvOffChanges'
|
|
243
243
|
+ ` Active: ${this.Television.Active}, disablePushOff: ${this.disablePushOff}`);
|
|
244
244
|
if (this.Television.Active === this.hap.Characteristic.Active.INACTIVE && !this.disablePushOff) {
|
|
245
245
|
const commandType: string = await this.commandType();
|
|
@@ -254,7 +254,7 @@ export class TV extends irdeviceBase {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
async pushOkChanges(): Promise<void> {
|
|
257
|
-
this.debugLog(
|
|
257
|
+
await this.debugLog(`pushOkChanges disablePushDetail: ${this.disablePushDetail}`);
|
|
258
258
|
if (!this.disablePushDetail) {
|
|
259
259
|
const bodyChange = JSON.stringify({
|
|
260
260
|
command: 'Ok',
|
|
@@ -266,7 +266,7 @@ export class TV extends irdeviceBase {
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
async pushBackChanges(): Promise<void> {
|
|
269
|
-
this.debugLog(
|
|
269
|
+
await this.debugLog(`pushBackChanges disablePushDetail: ${this.disablePushDetail}`);
|
|
270
270
|
if (!this.disablePushDetail) {
|
|
271
271
|
const bodyChange = JSON.stringify({
|
|
272
272
|
command: 'Back',
|
|
@@ -278,7 +278,7 @@ export class TV extends irdeviceBase {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
async pushMenuChanges(): Promise<void> {
|
|
281
|
-
this.debugLog(
|
|
281
|
+
await this.debugLog(`pushMenuChanges disablePushDetail: ${this.disablePushDetail}`);
|
|
282
282
|
if (!this.disablePushDetail) {
|
|
283
283
|
const bodyChange = JSON.stringify({
|
|
284
284
|
command: 'Menu',
|
|
@@ -290,7 +290,7 @@ export class TV extends irdeviceBase {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
async pushUpChanges(): Promise<void> {
|
|
293
|
-
this.debugLog(
|
|
293
|
+
await this.debugLog(`pushUpChanges disablePushDetail: ${this.disablePushDetail}`);
|
|
294
294
|
if (!this.disablePushDetail) {
|
|
295
295
|
const bodyChange = JSON.stringify({
|
|
296
296
|
command: 'Up',
|
|
@@ -302,7 +302,7 @@ export class TV extends irdeviceBase {
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
async pushDownChanges(): Promise<void> {
|
|
305
|
-
this.debugLog(
|
|
305
|
+
await this.debugLog(`pushDownChanges disablePushDetail: ${this.disablePushDetail}`);
|
|
306
306
|
if (!this.disablePushDetail) {
|
|
307
307
|
const bodyChange = JSON.stringify({
|
|
308
308
|
command: 'Down',
|
|
@@ -314,7 +314,7 @@ export class TV extends irdeviceBase {
|
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
async pushRightChanges(): Promise<void> {
|
|
317
|
-
this.debugLog(
|
|
317
|
+
await this.debugLog(`pushRightChanges disablePushDetail: ${this.disablePushDetail}`);
|
|
318
318
|
if (!this.disablePushDetail) {
|
|
319
319
|
const bodyChange = JSON.stringify({
|
|
320
320
|
command: 'Right',
|
|
@@ -326,7 +326,7 @@ export class TV extends irdeviceBase {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
async pushLeftChanges(): Promise<void> {
|
|
329
|
-
this.debugLog(
|
|
329
|
+
await this.debugLog(`pushLeftChanges disablePushDetail: ${this.disablePushDetail}`);
|
|
330
330
|
if (!this.disablePushDetail) {
|
|
331
331
|
const bodyChange = JSON.stringify({
|
|
332
332
|
command: 'Left',
|
|
@@ -338,7 +338,7 @@ export class TV extends irdeviceBase {
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
async pushVolumeUpChanges(): Promise<void> {
|
|
341
|
-
this.debugLog(
|
|
341
|
+
await this.debugLog(`pushVolumeUpChanges disablePushDetail: ${this.disablePushDetail}`);
|
|
342
342
|
if (!this.disablePushDetail) {
|
|
343
343
|
const bodyChange = JSON.stringify({
|
|
344
344
|
command: 'volumeAdd',
|
|
@@ -350,7 +350,7 @@ export class TV extends irdeviceBase {
|
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
async pushVolumeDownChanges(): Promise<void> {
|
|
353
|
-
this.debugLog(
|
|
353
|
+
await this.debugLog(`pushVolumeDownChanges disablePushDetail: ${this.disablePushDetail}`);
|
|
354
354
|
if (!this.disablePushDetail) {
|
|
355
355
|
const bodyChange = JSON.stringify({
|
|
356
356
|
command: 'volumeSub',
|
|
@@ -362,9 +362,9 @@ export class TV extends irdeviceBase {
|
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
async pushTVChanges(bodyChange: any): Promise<void> {
|
|
365
|
-
this.debugLog(
|
|
365
|
+
await this.debugLog('pushTVChanges');
|
|
366
366
|
if (this.device.connectionType === 'OpenAPI') {
|
|
367
|
-
this.infoLog(
|
|
367
|
+
await this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
368
368
|
try {
|
|
369
369
|
const { body, statusCode } = await this.pushChangeRequest(bodyChange);
|
|
370
370
|
const deviceStatus: any = await body.json();
|
|
@@ -381,27 +381,27 @@ export class TV extends irdeviceBase {
|
|
|
381
381
|
await this.pushChangeError(e);
|
|
382
382
|
}
|
|
383
383
|
} else {
|
|
384
|
-
this.warnLog(
|
|
385
|
-
+ ` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
384
|
+
await this.warnLog(`Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
386
385
|
}
|
|
387
386
|
}
|
|
388
387
|
|
|
389
388
|
async updateHomeKitCharacteristics(): Promise<void> {
|
|
389
|
+
await this.debugLog('updateHomeKitCharacteristics');
|
|
390
390
|
// Active
|
|
391
391
|
if (this.Television.Active === undefined) {
|
|
392
|
-
this.debugLog(
|
|
392
|
+
await this.debugLog(`Active: ${this.Television.Active}`);
|
|
393
393
|
} else {
|
|
394
394
|
this.accessory.context.Active = this.Television.Active;
|
|
395
395
|
this.Television.Service.updateCharacteristic(this.hap.Characteristic.Active, this.Television.Active);
|
|
396
|
-
this.debugLog(
|
|
396
|
+
await this.debugLog(`updateCharacteristic Active: ${this.Television.Active}`);
|
|
397
397
|
}
|
|
398
398
|
// ActiveIdentifier
|
|
399
399
|
if (this.Television.ActiveIdentifier === undefined) {
|
|
400
|
-
this.debugLog(
|
|
400
|
+
await this.debugLog(`ActiveIdentifier: ${this.Television.ActiveIdentifier}`);
|
|
401
401
|
} else {
|
|
402
402
|
this.accessory.context.ActiveIdentifier = this.Television.ActiveIdentifier;
|
|
403
403
|
this.Television.Service.updateCharacteristic(this.hap.Characteristic.ActiveIdentifier, this.Television.ActiveIdentifier);
|
|
404
|
-
this.debugLog(
|
|
404
|
+
await this.debugLog('updateCharacteristic'
|
|
405
405
|
+ ` ActiveIdentifier: ${this.Television.ActiveIdentifier}`);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
@@ -48,7 +48,7 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
async OnSet(value: CharacteristicValue): Promise<void> {
|
|
51
|
-
this.debugLog(
|
|
51
|
+
await this.debugLog(`On: ${value}`);
|
|
52
52
|
|
|
53
53
|
// Set the requested state
|
|
54
54
|
this.Switch.On = value;
|
|
@@ -66,7 +66,7 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
66
66
|
* Vacuum Cleaner "command" "turnOn" "default" set to ON state
|
|
67
67
|
*/
|
|
68
68
|
async pushOnChanges(): Promise<void> {
|
|
69
|
-
this.debugLog(
|
|
69
|
+
await this.debugLog('pushOnChanges'
|
|
70
70
|
+ ` On: ${this.Switch.On}, disablePushOn: ${this.disablePushOn}`);
|
|
71
71
|
if (this.Switch.On && !this.disablePushOn) {
|
|
72
72
|
const commandType: string = await this.commandType();
|
|
@@ -81,7 +81,7 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
async pushOffChanges(): Promise<void> {
|
|
84
|
-
this.debugLog(
|
|
84
|
+
await this.debugLog('pushOffChanges'
|
|
85
85
|
+ ` On: ${this.Switch.On}, disablePushOff: ${this.disablePushOff}`);
|
|
86
86
|
if (!this.Switch.On && !this.disablePushOff) {
|
|
87
87
|
const commandType: string = await this.commandType();
|
|
@@ -96,9 +96,9 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
async pushChanges(bodyChange: any): Promise<void> {
|
|
99
|
-
this.debugLog(
|
|
99
|
+
await this.debugLog('pushChanges');
|
|
100
100
|
if (this.device.connectionType === 'OpenAPI') {
|
|
101
|
-
this.infoLog(
|
|
101
|
+
await this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
102
102
|
try {
|
|
103
103
|
const { body, statusCode } = await this.pushChangeRequest(bodyChange);
|
|
104
104
|
const deviceStatus: any = await body.json();
|
|
@@ -115,19 +115,19 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
115
115
|
await this.pushChangeError(e);
|
|
116
116
|
}
|
|
117
117
|
} else {
|
|
118
|
-
this.warnLog(
|
|
119
|
-
+ ` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
118
|
+
await this.warnLog(`Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
async updateHomeKitCharacteristics(): Promise<void> {
|
|
123
|
+
await this.debugLog('updateHomeKitCharacteristics');
|
|
124
124
|
// On
|
|
125
125
|
if (this.Switch.On === undefined) {
|
|
126
|
-
this.debugLog(
|
|
126
|
+
await this.debugLog(`On: ${this.Switch.On}`);
|
|
127
127
|
} else {
|
|
128
128
|
this.accessory.context.On = this.Switch.On;
|
|
129
129
|
this.Switch.Service.updateCharacteristic(this.hap.Characteristic.On, this.Switch.On);
|
|
130
|
-
this.debugLog(
|
|
130
|
+
await this.debugLog(`updateCharacteristic On: ${this.Switch.On}`);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -49,7 +49,7 @@ export class WaterHeater extends irdeviceBase {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
async ActiveSet(value: CharacteristicValue): Promise<void> {
|
|
52
|
-
this.debugLog(
|
|
52
|
+
await this.debugLog(`Active: ${value}`);
|
|
53
53
|
|
|
54
54
|
this.Valve.Active = value;
|
|
55
55
|
if (this.Valve.Active === this.hap.Characteristic.Active.ACTIVE) {
|
|
@@ -68,7 +68,7 @@ export class WaterHeater extends irdeviceBase {
|
|
|
68
68
|
* WaterHeater "command" "turnOn" "default" set to ON state
|
|
69
69
|
*/
|
|
70
70
|
async pushWaterHeaterOnChanges(): Promise<void> {
|
|
71
|
-
this.debugLog(
|
|
71
|
+
await this.debugLog(`pushWaterHeaterOnChanges Active: ${this.Valve.Active},`
|
|
72
72
|
+ ` disablePushOn: ${this.disablePushOn}`);
|
|
73
73
|
if (this.Valve.Active === this.hap.Characteristic.Active.ACTIVE && !this.disablePushOn) {
|
|
74
74
|
const commandType: string = await this.commandType();
|
|
@@ -83,7 +83,7 @@ export class WaterHeater extends irdeviceBase {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
async pushWaterHeaterOffChanges(): Promise<void> {
|
|
86
|
-
this.debugLog(
|
|
86
|
+
await this.debugLog(`pushWaterHeaterOffChanges Active: ${this.Valve.Active},`
|
|
87
87
|
+ ` disablePushOff: ${this.disablePushOff}`);
|
|
88
88
|
if (this.Valve.Active === this.hap.Characteristic.Active.INACTIVE && !this.disablePushOff) {
|
|
89
89
|
const commandType: string = await this.commandType();
|
|
@@ -98,9 +98,9 @@ export class WaterHeater extends irdeviceBase {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
async pushChanges(bodyChange: any): Promise<void> {
|
|
101
|
-
this.debugLog(
|
|
101
|
+
await this.debugLog('pushChanges');
|
|
102
102
|
if (this.device.connectionType === 'OpenAPI') {
|
|
103
|
-
this.infoLog(
|
|
103
|
+
this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
104
104
|
try {
|
|
105
105
|
const { body, statusCode } = await this.pushChangeRequest(bodyChange);
|
|
106
106
|
const deviceStatus: any = await body.json();
|
|
@@ -117,19 +117,19 @@ export class WaterHeater extends irdeviceBase {
|
|
|
117
117
|
await this.pushChangeError(e);
|
|
118
118
|
}
|
|
119
119
|
} else {
|
|
120
|
-
this.warnLog(
|
|
121
|
-
+ ` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
120
|
+
await this.warnLog(`Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
async updateHomeKitCharacteristics(): Promise<void> {
|
|
125
|
+
await this.debugLog('updateHomeKitCharacteristics');
|
|
126
126
|
// Active
|
|
127
127
|
if (this.Valve.Active === undefined) {
|
|
128
|
-
this.debugLog(
|
|
128
|
+
await this.debugLog(`Active: ${this.Valve.Active}`);
|
|
129
129
|
} else {
|
|
130
130
|
this.accessory.context.Active = this.Valve.Active;
|
|
131
131
|
this.Valve.Service.updateCharacteristic(this.hap.Characteristic.Active, this.Valve.Active);
|
|
132
|
-
this.debugLog(
|
|
132
|
+
await this.debugLog(`updateCharacteristic Active: ${this.Valve.Active}`);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|