@switchbot/homebridge-switchbot 3.5.1-beta.1 → 3.5.1-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/README.md +16 -0
  2. package/dist/device/blindtilt.d.ts +15 -6
  3. package/dist/device/blindtilt.d.ts.map +1 -1
  4. package/dist/device/blindtilt.js +203 -255
  5. package/dist/device/blindtilt.js.map +1 -1
  6. package/dist/device/bot.d.ts +9 -4
  7. package/dist/device/bot.d.ts.map +1 -1
  8. package/dist/device/bot.js +196 -218
  9. package/dist/device/bot.js.map +1 -1
  10. package/dist/device/ceilinglight.d.ts +9 -4
  11. package/dist/device/ceilinglight.d.ts.map +1 -1
  12. package/dist/device/ceilinglight.js +203 -249
  13. package/dist/device/ceilinglight.js.map +1 -1
  14. package/dist/device/colorbulb.d.ts +10 -5
  15. package/dist/device/colorbulb.d.ts.map +1 -1
  16. package/dist/device/colorbulb.js +329 -378
  17. package/dist/device/colorbulb.js.map +1 -1
  18. package/dist/device/contact.d.ts +9 -4
  19. package/dist/device/contact.d.ts.map +1 -1
  20. package/dist/device/contact.js +99 -142
  21. package/dist/device/contact.js.map +1 -1
  22. package/dist/device/curtain.d.ts +19 -7
  23. package/dist/device/curtain.d.ts.map +1 -1
  24. package/dist/device/curtain.js +203 -264
  25. package/dist/device/curtain.js.map +1 -1
  26. package/dist/device/device.d.ts +28 -32
  27. package/dist/device/device.d.ts.map +1 -1
  28. package/dist/device/device.js +186 -225
  29. package/dist/device/device.js.map +1 -1
  30. package/dist/device/fan.d.ts +9 -4
  31. package/dist/device/fan.d.ts.map +1 -1
  32. package/dist/device/fan.js +198 -227
  33. package/dist/device/fan.js.map +1 -1
  34. package/dist/device/hub.d.ts +9 -5
  35. package/dist/device/hub.d.ts.map +1 -1
  36. package/dist/device/hub.js +106 -231
  37. package/dist/device/hub.js.map +1 -1
  38. package/dist/device/humidifier.d.ts +12 -4
  39. package/dist/device/humidifier.d.ts.map +1 -1
  40. package/dist/device/humidifier.js +192 -232
  41. package/dist/device/humidifier.js.map +1 -1
  42. package/dist/device/iosensor.d.ts +9 -4
  43. package/dist/device/iosensor.d.ts.map +1 -1
  44. package/dist/device/iosensor.js +91 -157
  45. package/dist/device/iosensor.js.map +1 -1
  46. package/dist/device/lightstrip.d.ts +10 -5
  47. package/dist/device/lightstrip.d.ts.map +1 -1
  48. package/dist/device/lightstrip.js +287 -367
  49. package/dist/device/lightstrip.js.map +1 -1
  50. package/dist/device/lock.d.ts +10 -5
  51. package/dist/device/lock.d.ts.map +1 -1
  52. package/dist/device/lock.js +171 -216
  53. package/dist/device/lock.js.map +1 -1
  54. package/dist/device/meter.d.ts +9 -4
  55. package/dist/device/meter.d.ts.map +1 -1
  56. package/dist/device/meter.js +93 -158
  57. package/dist/device/meter.js.map +1 -1
  58. package/dist/device/meterplus.d.ts +9 -4
  59. package/dist/device/meterplus.d.ts.map +1 -1
  60. package/dist/device/meterplus.js +94 -155
  61. package/dist/device/meterplus.js.map +1 -1
  62. package/dist/device/motion.d.ts +9 -4
  63. package/dist/device/motion.d.ts.map +1 -1
  64. package/dist/device/motion.js +84 -142
  65. package/dist/device/motion.js.map +1 -1
  66. package/dist/device/plug.d.ts +9 -4
  67. package/dist/device/plug.d.ts.map +1 -1
  68. package/dist/device/plug.js +99 -124
  69. package/dist/device/plug.js.map +1 -1
  70. package/dist/device/robotvacuumcleaner.d.ts +9 -6
  71. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  72. package/dist/device/robotvacuumcleaner.js +170 -253
  73. package/dist/device/robotvacuumcleaner.js.map +1 -1
  74. package/dist/device/waterdetector.d.ts +12 -4
  75. package/dist/device/waterdetector.d.ts.map +1 -1
  76. package/dist/device/waterdetector.js +105 -129
  77. package/dist/device/waterdetector.js.map +1 -1
  78. package/dist/irdevice/airconditioner.d.ts +2 -1
  79. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  80. package/dist/irdevice/airconditioner.js +45 -51
  81. package/dist/irdevice/airconditioner.js.map +1 -1
  82. package/dist/irdevice/airpurifier.d.ts +2 -1
  83. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  84. package/dist/irdevice/airpurifier.js +17 -17
  85. package/dist/irdevice/airpurifier.js.map +1 -1
  86. package/dist/irdevice/camera.d.ts +2 -1
  87. package/dist/irdevice/camera.d.ts.map +1 -1
  88. package/dist/irdevice/camera.js +9 -9
  89. package/dist/irdevice/camera.js.map +1 -1
  90. package/dist/irdevice/fan.d.ts +2 -1
  91. package/dist/irdevice/fan.d.ts.map +1 -1
  92. package/dist/irdevice/fan.js +19 -19
  93. package/dist/irdevice/fan.js.map +1 -1
  94. package/dist/irdevice/irdevice.d.ts +24 -11
  95. package/dist/irdevice/irdevice.d.ts.map +1 -1
  96. package/dist/irdevice/irdevice.js +90 -68
  97. package/dist/irdevice/irdevice.js.map +1 -1
  98. package/dist/irdevice/light.d.ts +2 -1
  99. package/dist/irdevice/light.d.ts.map +1 -1
  100. package/dist/irdevice/light.js +15 -17
  101. package/dist/irdevice/light.js.map +1 -1
  102. package/dist/irdevice/other.d.ts +2 -1
  103. package/dist/irdevice/other.d.ts.map +1 -1
  104. package/dist/irdevice/other.js +76 -76
  105. package/dist/irdevice/other.js.map +1 -1
  106. package/dist/irdevice/tv.d.ts +2 -1
  107. package/dist/irdevice/tv.d.ts.map +1 -1
  108. package/dist/irdevice/tv.js +35 -35
  109. package/dist/irdevice/tv.js.map +1 -1
  110. package/dist/irdevice/vacuumcleaner.d.ts +2 -1
  111. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  112. package/dist/irdevice/vacuumcleaner.js +9 -9
  113. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  114. package/dist/irdevice/waterheater.d.ts +2 -1
  115. package/dist/irdevice/waterheater.d.ts.map +1 -1
  116. package/dist/irdevice/waterheater.js +9 -9
  117. package/dist/irdevice/waterheater.js.map +1 -1
  118. package/dist/platform.d.ts +15 -15
  119. package/dist/platform.d.ts.map +1 -1
  120. package/dist/platform.js +288 -271
  121. package/dist/platform.js.map +1 -1
  122. package/dist/settings.d.ts +49 -191
  123. package/dist/settings.d.ts.map +1 -1
  124. package/dist/settings.js +19 -0
  125. package/dist/settings.js.map +1 -1
  126. package/dist/types/bledevicestatus.d.ts +279 -0
  127. package/dist/types/bledevicestatus.d.ts.map +1 -0
  128. package/dist/types/bledevicestatus.js +2 -0
  129. package/dist/types/bledevicestatus.js.map +1 -0
  130. package/dist/types/devicelist.d.ts +89 -0
  131. package/dist/types/devicelist.d.ts.map +1 -0
  132. package/dist/types/devicelist.js +6 -0
  133. package/dist/types/devicelist.js.map +1 -0
  134. package/dist/types/deviceresponse.d.ts +13 -0
  135. package/dist/types/deviceresponse.d.ts.map +1 -0
  136. package/dist/types/deviceresponse.js +2 -0
  137. package/dist/types/deviceresponse.js.map +1 -0
  138. package/dist/types/devicestatus.d.ts +149 -0
  139. package/dist/types/devicestatus.d.ts.map +1 -0
  140. package/dist/types/devicestatus.js +3 -0
  141. package/dist/types/devicestatus.js.map +1 -0
  142. package/dist/types/devicewebhookstatus.d.ts +156 -0
  143. package/dist/types/devicewebhookstatus.d.ts.map +1 -0
  144. package/dist/types/devicewebhookstatus.js +2 -0
  145. package/dist/types/devicewebhookstatus.js.map +1 -0
  146. package/dist/types/irdevicelist.d.ts +10 -0
  147. package/dist/types/irdevicelist.d.ts.map +1 -0
  148. package/dist/types/irdevicelist.js +2 -0
  149. package/dist/types/irdevicelist.js.map +1 -0
  150. package/dist/types/pushbody.d.ts +6 -0
  151. package/dist/types/pushbody.d.ts.map +1 -0
  152. package/dist/types/pushbody.js +2 -0
  153. package/dist/types/pushbody.js.map +1 -0
  154. package/dist/utils.d.ts +25 -0
  155. package/dist/utils.d.ts.map +1 -1
  156. package/dist/utils.js +28 -0
  157. package/dist/utils.js.map +1 -1
  158. package/package.json +10 -10
  159. package/src/device/blindtilt.ts +224 -264
  160. package/src/device/bot.ts +208 -221
  161. package/src/device/ceilinglight.ts +211 -261
  162. package/src/device/colorbulb.ts +334 -397
  163. package/src/device/contact.ts +111 -146
  164. package/src/device/curtain.ts +220 -283
  165. package/src/device/device.ts +194 -245
  166. package/src/device/fan.ts +214 -230
  167. package/src/device/hub.ts +126 -246
  168. package/src/device/humidifier.ts +216 -243
  169. package/src/device/iosensor.ts +114 -166
  170. package/src/device/lightstrip.ts +302 -377
  171. package/src/device/lock.ts +187 -221
  172. package/src/device/meter.ts +116 -177
  173. package/src/device/meterplus.ts +117 -174
  174. package/src/device/motion.ts +99 -144
  175. package/src/device/plug.ts +110 -128
  176. package/src/device/robotvacuumcleaner.ts +189 -252
  177. package/src/device/waterdetector.ts +123 -139
  178. package/src/irdevice/airconditioner.ts +47 -52
  179. package/src/irdevice/airpurifier.ts +19 -18
  180. package/src/irdevice/camera.ts +11 -10
  181. package/src/irdevice/fan.ts +21 -20
  182. package/src/irdevice/irdevice.ts +95 -70
  183. package/src/irdevice/light.ts +17 -18
  184. package/src/irdevice/other.ts +78 -77
  185. package/src/irdevice/tv.ts +37 -36
  186. package/src/irdevice/vacuumcleaner.ts +11 -10
  187. package/src/irdevice/waterheater.ts +11 -10
  188. package/src/platform.ts +290 -272
  189. package/src/settings.ts +30 -239
  190. package/src/types/bledevicestatus.ts +305 -0
  191. package/src/types/devicelist.ts +124 -0
  192. package/src/types/deviceresponse.ts +15 -0
  193. package/src/types/devicestatus.ts +178 -0
  194. package/src/types/devicewebhookstatus.ts +196 -0
  195. package/src/types/irdevicelist.ts +15 -0
  196. package/src/types/pushbody.ts +9 -0
  197. package/src/utils.ts +33 -0
@@ -5,7 +5,8 @@
5
5
  import { irdeviceBase } from './irdevice.js';
6
6
 
7
7
  import type { SwitchBotPlatform } from '../platform.js';
8
- import type { irDevicesConfig, irdevice } from '../settings.js';
8
+ import type { irDevicesConfig } from '../settings.js';
9
+ import type { irdevice } from '../types/irdevicelist.js';
9
10
  import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
10
11
 
11
12
  /**
@@ -124,7 +125,7 @@ export class TV extends irdeviceBase {
124
125
  }
125
126
 
126
127
  async VolumeSelectorSet(value: CharacteristicValue): Promise<void> {
127
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} VolumeSelector: ${value}`);
128
+ await this.debugLog(`VolumeSelector: ${value}`);
128
129
  if (value === this.hap.Characteristic.VolumeSelector.INCREMENT) {
129
130
  this.pushVolumeUpChanges();
130
131
  } else {
@@ -135,61 +136,61 @@ export class TV extends irdeviceBase {
135
136
  async RemoteKeySet(value: CharacteristicValue): Promise<void> {
136
137
  switch (value) {
137
138
  case this.hap.Characteristic.RemoteKey.REWIND: {
138
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: REWIND`);
139
+ await this.debugLog('Set Remote Key Pressed: REWIND');
139
140
  break;
140
141
  }
141
142
  case this.hap.Characteristic.RemoteKey.FAST_FORWARD: {
142
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: FAST_FORWARD`);
143
+ await this.debugLog('Set Remote Key Pressed: FAST_FORWARD');
143
144
  break;
144
145
  }
145
146
  case this.hap.Characteristic.RemoteKey.NEXT_TRACK: {
146
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: NEXT_TRACK`);
147
+ await this.debugLog('Set Remote Key Pressed: NEXT_TRACK');
147
148
  break;
148
149
  }
149
150
  case this.hap.Characteristic.RemoteKey.PREVIOUS_TRACK: {
150
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: PREVIOUS_TRACK`);
151
+ await this.debugLog('Set Remote Key Pressed: PREVIOUS_TRACK');
151
152
  break;
152
153
  }
153
154
  case this.hap.Characteristic.RemoteKey.ARROW_UP: {
154
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: ARROW_UP`);
155
+ await this.debugLog('Set Remote Key Pressed: ARROW_UP');
155
156
  //this.pushUpChanges();
156
157
  break;
157
158
  }
158
159
  case this.hap.Characteristic.RemoteKey.ARROW_DOWN: {
159
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: ARROW_DOWN`);
160
+ await this.debugLog('Set Remote Key Pressed: ARROW_DOWN');
160
161
  //this.pushDownChanges();
161
162
  break;
162
163
  }
163
164
  case this.hap.Characteristic.RemoteKey.ARROW_LEFT: {
164
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: ARROW_LEFT`);
165
+ await this.debugLog('Set Remote Key Pressed: ARROW_LEFT');
165
166
  //this.pushLeftChanges();
166
167
  break;
167
168
  }
168
169
  case this.hap.Characteristic.RemoteKey.ARROW_RIGHT: {
169
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: ARROW_RIGHT`);
170
+ await this.debugLog('Set Remote Key Pressed: ARROW_RIGHT');
170
171
  //this.pushRightChanges();
171
172
  break;
172
173
  }
173
174
  case this.hap.Characteristic.RemoteKey.SELECT: {
174
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: SELECT`);
175
+ await this.debugLog('Set Remote Key Pressed: SELECT');
175
176
  //this.pushOkChanges();
176
177
  break;
177
178
  }
178
179
  case this.hap.Characteristic.RemoteKey.BACK: {
179
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: BACK`);
180
+ await this.debugLog('Set Remote Key Pressed: BACK');
180
181
  //this.pushBackChanges();
181
182
  break;
182
183
  }
183
184
  case this.hap.Characteristic.RemoteKey.EXIT: {
184
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: EXIT`);
185
+ await this.debugLog('Set Remote Key Pressed: EXIT');
185
186
  break;
186
187
  }
187
188
  case this.hap.Characteristic.RemoteKey.PLAY_PAUSE: {
188
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: PLAY_PAUSE`);
189
+ await this.debugLog('Set Remote Key Pressed: PLAY_PAUSE');
189
190
  break;
190
191
  }
191
192
  case this.hap.Characteristic.RemoteKey.INFORMATION: {
192
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Set Remote Key Pressed: INFORMATION`);
193
+ await this.debugLog('Set Remote Key Pressed: INFORMATION');
193
194
  //this.pushMenuChanges();
194
195
  break;
195
196
  }
@@ -197,12 +198,12 @@ export class TV extends irdeviceBase {
197
198
  }
198
199
 
199
200
  async ActiveIdentifierSet(value: CharacteristicValue): Promise<void> {
200
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} ActiveIdentifier: ${value}`);
201
+ await this.debugLog(`ActiveIdentifier: ${value}`);
201
202
  this.Television.ActiveIdentifier = value;
202
203
  }
203
204
 
204
205
  async ActiveSet(value: CharacteristicValue): Promise<void> {
205
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active (value): ${value}`);
206
+ await this.debugLog(`Active (value): ${value}`);
206
207
 
207
208
  this.Television.Active = value;
208
209
  if (this.Television.Active === this.hap.Characteristic.Active.ACTIVE) {
@@ -223,7 +224,7 @@ export class TV extends irdeviceBase {
223
224
  * TV "command" "channelSub" "default" previous channel
224
225
  */
225
226
  async pushTvOnChanges(): Promise<void> {
226
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushTvOnChanges`
227
+ await this.debugLog('pushTvOnChanges'
227
228
  + ` Active: ${this.Television.Active}, disablePushOn: ${this.disablePushOn}`);
228
229
  if (this.Television.Active === this.hap.Characteristic.Active.ACTIVE && !this.disablePushOn) {
229
230
  const commandType: string = await this.commandType();
@@ -238,7 +239,7 @@ export class TV extends irdeviceBase {
238
239
  }
239
240
 
240
241
  async pushTvOffChanges(): Promise<void> {
241
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushTvOffChanges`
242
+ await this.debugLog('pushTvOffChanges'
242
243
  + ` Active: ${this.Television.Active}, disablePushOff: ${this.disablePushOff}`);
243
244
  if (this.Television.Active === this.hap.Characteristic.Active.INACTIVE && !this.disablePushOff) {
244
245
  const commandType: string = await this.commandType();
@@ -253,7 +254,7 @@ export class TV extends irdeviceBase {
253
254
  }
254
255
 
255
256
  async pushOkChanges(): Promise<void> {
256
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushOkChanges disablePushDetail: ${this.disablePushDetail}`);
257
+ await this.debugLog(`pushOkChanges disablePushDetail: ${this.disablePushDetail}`);
257
258
  if (!this.disablePushDetail) {
258
259
  const bodyChange = JSON.stringify({
259
260
  command: 'Ok',
@@ -265,7 +266,7 @@ export class TV extends irdeviceBase {
265
266
  }
266
267
 
267
268
  async pushBackChanges(): Promise<void> {
268
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushBackChanges disablePushDetail: ${this.disablePushDetail}`);
269
+ await this.debugLog(`pushBackChanges disablePushDetail: ${this.disablePushDetail}`);
269
270
  if (!this.disablePushDetail) {
270
271
  const bodyChange = JSON.stringify({
271
272
  command: 'Back',
@@ -277,7 +278,7 @@ export class TV extends irdeviceBase {
277
278
  }
278
279
 
279
280
  async pushMenuChanges(): Promise<void> {
280
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushMenuChanges disablePushDetail: ${this.disablePushDetail}`);
281
+ await this.debugLog(`pushMenuChanges disablePushDetail: ${this.disablePushDetail}`);
281
282
  if (!this.disablePushDetail) {
282
283
  const bodyChange = JSON.stringify({
283
284
  command: 'Menu',
@@ -289,7 +290,7 @@ export class TV extends irdeviceBase {
289
290
  }
290
291
 
291
292
  async pushUpChanges(): Promise<void> {
292
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushUpChanges disablePushDetail: ${this.disablePushDetail}`);
293
+ await this.debugLog(`pushUpChanges disablePushDetail: ${this.disablePushDetail}`);
293
294
  if (!this.disablePushDetail) {
294
295
  const bodyChange = JSON.stringify({
295
296
  command: 'Up',
@@ -301,7 +302,7 @@ export class TV extends irdeviceBase {
301
302
  }
302
303
 
303
304
  async pushDownChanges(): Promise<void> {
304
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushDownChanges disablePushDetail: ${this.disablePushDetail}`);
305
+ await this.debugLog(`pushDownChanges disablePushDetail: ${this.disablePushDetail}`);
305
306
  if (!this.disablePushDetail) {
306
307
  const bodyChange = JSON.stringify({
307
308
  command: 'Down',
@@ -313,7 +314,7 @@ export class TV extends irdeviceBase {
313
314
  }
314
315
 
315
316
  async pushRightChanges(): Promise<void> {
316
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushRightChanges disablePushDetail: ${this.disablePushDetail}`);
317
+ await this.debugLog(`pushRightChanges disablePushDetail: ${this.disablePushDetail}`);
317
318
  if (!this.disablePushDetail) {
318
319
  const bodyChange = JSON.stringify({
319
320
  command: 'Right',
@@ -325,7 +326,7 @@ export class TV extends irdeviceBase {
325
326
  }
326
327
 
327
328
  async pushLeftChanges(): Promise<void> {
328
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushLeftChanges disablePushDetail: ${this.disablePushDetail}`);
329
+ await this.debugLog(`pushLeftChanges disablePushDetail: ${this.disablePushDetail}`);
329
330
  if (!this.disablePushDetail) {
330
331
  const bodyChange = JSON.stringify({
331
332
  command: 'Left',
@@ -337,7 +338,7 @@ export class TV extends irdeviceBase {
337
338
  }
338
339
 
339
340
  async pushVolumeUpChanges(): Promise<void> {
340
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushVolumeUpChanges disablePushDetail: ${this.disablePushDetail}`);
341
+ await this.debugLog(`pushVolumeUpChanges disablePushDetail: ${this.disablePushDetail}`);
341
342
  if (!this.disablePushDetail) {
342
343
  const bodyChange = JSON.stringify({
343
344
  command: 'volumeAdd',
@@ -349,7 +350,7 @@ export class TV extends irdeviceBase {
349
350
  }
350
351
 
351
352
  async pushVolumeDownChanges(): Promise<void> {
352
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushVolumeDownChanges disablePushDetail: ${this.disablePushDetail}`);
353
+ await this.debugLog(`pushVolumeDownChanges disablePushDetail: ${this.disablePushDetail}`);
353
354
  if (!this.disablePushDetail) {
354
355
  const bodyChange = JSON.stringify({
355
356
  command: 'volumeSub',
@@ -361,9 +362,9 @@ export class TV extends irdeviceBase {
361
362
  }
362
363
 
363
364
  async pushTVChanges(bodyChange: any): Promise<void> {
364
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushTVChanges`);
365
+ await this.debugLog('pushTVChanges');
365
366
  if (this.device.connectionType === 'OpenAPI') {
366
- this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
367
+ await this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`);
367
368
  try {
368
369
  const { body, statusCode } = await this.pushChangeRequest(bodyChange);
369
370
  const deviceStatus: any = await body.json();
@@ -380,27 +381,27 @@ export class TV extends irdeviceBase {
380
381
  await this.pushChangeError(e);
381
382
  }
382
383
  } else {
383
- this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
384
- + ` 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`);
385
385
  }
386
386
  }
387
387
 
388
388
  async updateHomeKitCharacteristics(): Promise<void> {
389
+ await this.debugLog('updateHomeKitCharacteristics');
389
390
  // Active
390
391
  if (this.Television.Active === undefined) {
391
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${this.Television.Active}`);
392
+ await this.debugLog(`Active: ${this.Television.Active}`);
392
393
  } else {
393
394
  this.accessory.context.Active = this.Television.Active;
394
395
  this.Television.Service.updateCharacteristic(this.hap.Characteristic.Active, this.Television.Active);
395
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Television.Active}`);
396
+ await this.debugLog(`updateCharacteristic Active: ${this.Television.Active}`);
396
397
  }
397
398
  // ActiveIdentifier
398
399
  if (this.Television.ActiveIdentifier === undefined) {
399
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} ActiveIdentifier: ${this.Television.ActiveIdentifier}`);
400
+ await this.debugLog(`ActiveIdentifier: ${this.Television.ActiveIdentifier}`);
400
401
  } else {
401
402
  this.accessory.context.ActiveIdentifier = this.Television.ActiveIdentifier;
402
403
  this.Television.Service.updateCharacteristic(this.hap.Characteristic.ActiveIdentifier, this.Television.ActiveIdentifier);
403
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic`
404
+ await this.debugLog('updateCharacteristic'
404
405
  + ` ActiveIdentifier: ${this.Television.ActiveIdentifier}`);
405
406
  }
406
407
  }
@@ -5,7 +5,8 @@
5
5
  import { irdeviceBase } from './irdevice.js';
6
6
 
7
7
  import type { SwitchBotPlatform } from '../platform.js';
8
- import type { irDevicesConfig, irdevice } from '../settings.js';
8
+ import type { irDevicesConfig } from '../settings.js';
9
+ import type { irdevice } from '../types/irdevicelist.js';
9
10
  import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
10
11
 
11
12
  /**
@@ -47,7 +48,7 @@ export class VacuumCleaner extends irdeviceBase {
47
48
  }
48
49
 
49
50
  async OnSet(value: CharacteristicValue): Promise<void> {
50
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${value}`);
51
+ await this.debugLog(`On: ${value}`);
51
52
 
52
53
  // Set the requested state
53
54
  this.Switch.On = value;
@@ -65,7 +66,7 @@ export class VacuumCleaner extends irdeviceBase {
65
66
  * Vacuum Cleaner "command" "turnOn" "default" set to ON state
66
67
  */
67
68
  async pushOnChanges(): Promise<void> {
68
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushOnChanges`
69
+ await this.debugLog('pushOnChanges'
69
70
  + ` On: ${this.Switch.On}, disablePushOn: ${this.disablePushOn}`);
70
71
  if (this.Switch.On && !this.disablePushOn) {
71
72
  const commandType: string = await this.commandType();
@@ -80,7 +81,7 @@ export class VacuumCleaner extends irdeviceBase {
80
81
  }
81
82
 
82
83
  async pushOffChanges(): Promise<void> {
83
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushOffChanges`
84
+ await this.debugLog('pushOffChanges'
84
85
  + ` On: ${this.Switch.On}, disablePushOff: ${this.disablePushOff}`);
85
86
  if (!this.Switch.On && !this.disablePushOff) {
86
87
  const commandType: string = await this.commandType();
@@ -95,9 +96,9 @@ export class VacuumCleaner extends irdeviceBase {
95
96
  }
96
97
 
97
98
  async pushChanges(bodyChange: any): Promise<void> {
98
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushChanges`);
99
+ await this.debugLog('pushChanges');
99
100
  if (this.device.connectionType === 'OpenAPI') {
100
- this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
101
+ await this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`);
101
102
  try {
102
103
  const { body, statusCode } = await this.pushChangeRequest(bodyChange);
103
104
  const deviceStatus: any = await body.json();
@@ -114,19 +115,19 @@ export class VacuumCleaner extends irdeviceBase {
114
115
  await this.pushChangeError(e);
115
116
  }
116
117
  } else {
117
- this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
118
- + ` 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`);
119
119
  }
120
120
  }
121
121
 
122
122
  async updateHomeKitCharacteristics(): Promise<void> {
123
+ await this.debugLog('updateHomeKitCharacteristics');
123
124
  // On
124
125
  if (this.Switch.On === undefined) {
125
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.Switch.On}`);
126
+ await this.debugLog(`On: ${this.Switch.On}`);
126
127
  } else {
127
128
  this.accessory.context.On = this.Switch.On;
128
129
  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}`);
130
+ await this.debugLog(`updateCharacteristic On: ${this.Switch.On}`);
130
131
  }
131
132
  }
132
133
 
@@ -5,7 +5,8 @@
5
5
  import { irdeviceBase } from './irdevice.js';
6
6
 
7
7
  import type { SwitchBotPlatform } from '../platform.js';
8
- import type { irDevicesConfig, irdevice } from '../settings.js';
8
+ import type { irDevicesConfig } from '../settings.js';
9
+ import type { irdevice } from '../types/irdevicelist.js';
9
10
  import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
10
11
 
11
12
  /**
@@ -48,7 +49,7 @@ export class WaterHeater extends irdeviceBase {
48
49
  }
49
50
 
50
51
  async ActiveSet(value: CharacteristicValue): Promise<void> {
51
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${value}`);
52
+ await this.debugLog(`Active: ${value}`);
52
53
 
53
54
  this.Valve.Active = value;
54
55
  if (this.Valve.Active === this.hap.Characteristic.Active.ACTIVE) {
@@ -67,7 +68,7 @@ export class WaterHeater extends irdeviceBase {
67
68
  * WaterHeater "command" "turnOn" "default" set to ON state
68
69
  */
69
70
  async pushWaterHeaterOnChanges(): Promise<void> {
70
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushWaterHeaterOnChanges Active: ${this.Valve.Active},`
71
+ await this.debugLog(`pushWaterHeaterOnChanges Active: ${this.Valve.Active},`
71
72
  + ` disablePushOn: ${this.disablePushOn}`);
72
73
  if (this.Valve.Active === this.hap.Characteristic.Active.ACTIVE && !this.disablePushOn) {
73
74
  const commandType: string = await this.commandType();
@@ -82,7 +83,7 @@ export class WaterHeater extends irdeviceBase {
82
83
  }
83
84
 
84
85
  async pushWaterHeaterOffChanges(): Promise<void> {
85
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushWaterHeaterOffChanges Active: ${this.Valve.Active},`
86
+ await this.debugLog(`pushWaterHeaterOffChanges Active: ${this.Valve.Active},`
86
87
  + ` disablePushOff: ${this.disablePushOff}`);
87
88
  if (this.Valve.Active === this.hap.Characteristic.Active.INACTIVE && !this.disablePushOff) {
88
89
  const commandType: string = await this.commandType();
@@ -97,9 +98,9 @@ export class WaterHeater extends irdeviceBase {
97
98
  }
98
99
 
99
100
  async pushChanges(bodyChange: any): Promise<void> {
100
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushChanges`);
101
+ await this.debugLog('pushChanges');
101
102
  if (this.device.connectionType === 'OpenAPI') {
102
- this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
103
+ this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`);
103
104
  try {
104
105
  const { body, statusCode } = await this.pushChangeRequest(bodyChange);
105
106
  const deviceStatus: any = await body.json();
@@ -116,19 +117,19 @@ export class WaterHeater extends irdeviceBase {
116
117
  await this.pushChangeError(e);
117
118
  }
118
119
  } else {
119
- this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
120
- + ` 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`);
121
121
  }
122
122
  }
123
123
 
124
124
  async updateHomeKitCharacteristics(): Promise<void> {
125
+ await this.debugLog('updateHomeKitCharacteristics');
125
126
  // Active
126
127
  if (this.Valve.Active === undefined) {
127
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Active: ${this.Valve.Active}`);
128
+ await this.debugLog(`Active: ${this.Valve.Active}`);
128
129
  } else {
129
130
  this.accessory.context.Active = this.Valve.Active;
130
131
  this.Valve.Service.updateCharacteristic(this.hap.Characteristic.Active, this.Valve.Active);
131
- this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic Active: ${this.Valve.Active}`);
132
+ await this.debugLog(`updateCharacteristic Active: ${this.Valve.Active}`);
132
133
  }
133
134
  }
134
135