@switchbot/homebridge-switchbot 3.5.1-beta.2 → 3.5.1-beta.3

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 (187) hide show
  1. package/dist/device/blindtilt.d.ts +15 -6
  2. package/dist/device/blindtilt.d.ts.map +1 -1
  3. package/dist/device/blindtilt.js +203 -255
  4. package/dist/device/blindtilt.js.map +1 -1
  5. package/dist/device/bot.d.ts +9 -4
  6. package/dist/device/bot.d.ts.map +1 -1
  7. package/dist/device/bot.js +196 -218
  8. package/dist/device/bot.js.map +1 -1
  9. package/dist/device/ceilinglight.d.ts +9 -4
  10. package/dist/device/ceilinglight.d.ts.map +1 -1
  11. package/dist/device/ceilinglight.js +202 -247
  12. package/dist/device/ceilinglight.js.map +1 -1
  13. package/dist/device/colorbulb.d.ts +10 -5
  14. package/dist/device/colorbulb.d.ts.map +1 -1
  15. package/dist/device/colorbulb.js +329 -378
  16. package/dist/device/colorbulb.js.map +1 -1
  17. package/dist/device/contact.d.ts +9 -4
  18. package/dist/device/contact.d.ts.map +1 -1
  19. package/dist/device/contact.js +99 -142
  20. package/dist/device/contact.js.map +1 -1
  21. package/dist/device/curtain.d.ts +19 -7
  22. package/dist/device/curtain.d.ts.map +1 -1
  23. package/dist/device/curtain.js +203 -264
  24. package/dist/device/curtain.js.map +1 -1
  25. package/dist/device/device.d.ts +28 -32
  26. package/dist/device/device.d.ts.map +1 -1
  27. package/dist/device/device.js +186 -225
  28. package/dist/device/device.js.map +1 -1
  29. package/dist/device/fan.d.ts +9 -4
  30. package/dist/device/fan.d.ts.map +1 -1
  31. package/dist/device/fan.js +198 -227
  32. package/dist/device/fan.js.map +1 -1
  33. package/dist/device/hub.d.ts +9 -5
  34. package/dist/device/hub.d.ts.map +1 -1
  35. package/dist/device/hub.js +106 -231
  36. package/dist/device/hub.js.map +1 -1
  37. package/dist/device/humidifier.d.ts +12 -4
  38. package/dist/device/humidifier.d.ts.map +1 -1
  39. package/dist/device/humidifier.js +192 -232
  40. package/dist/device/humidifier.js.map +1 -1
  41. package/dist/device/iosensor.d.ts +9 -4
  42. package/dist/device/iosensor.d.ts.map +1 -1
  43. package/dist/device/iosensor.js +91 -157
  44. package/dist/device/iosensor.js.map +1 -1
  45. package/dist/device/lightstrip.d.ts +10 -5
  46. package/dist/device/lightstrip.d.ts.map +1 -1
  47. package/dist/device/lightstrip.js +287 -367
  48. package/dist/device/lightstrip.js.map +1 -1
  49. package/dist/device/lock.d.ts +10 -5
  50. package/dist/device/lock.d.ts.map +1 -1
  51. package/dist/device/lock.js +171 -216
  52. package/dist/device/lock.js.map +1 -1
  53. package/dist/device/meter.d.ts +9 -4
  54. package/dist/device/meter.d.ts.map +1 -1
  55. package/dist/device/meter.js +93 -158
  56. package/dist/device/meter.js.map +1 -1
  57. package/dist/device/meterplus.d.ts +9 -4
  58. package/dist/device/meterplus.d.ts.map +1 -1
  59. package/dist/device/meterplus.js +94 -155
  60. package/dist/device/meterplus.js.map +1 -1
  61. package/dist/device/motion.d.ts +9 -4
  62. package/dist/device/motion.d.ts.map +1 -1
  63. package/dist/device/motion.js +84 -142
  64. package/dist/device/motion.js.map +1 -1
  65. package/dist/device/plug.d.ts +9 -4
  66. package/dist/device/plug.d.ts.map +1 -1
  67. package/dist/device/plug.js +99 -124
  68. package/dist/device/plug.js.map +1 -1
  69. package/dist/device/robotvacuumcleaner.d.ts +9 -6
  70. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  71. package/dist/device/robotvacuumcleaner.js +170 -253
  72. package/dist/device/robotvacuumcleaner.js.map +1 -1
  73. package/dist/device/waterdetector.d.ts +12 -4
  74. package/dist/device/waterdetector.d.ts.map +1 -1
  75. package/dist/device/waterdetector.js +102 -128
  76. package/dist/device/waterdetector.js.map +1 -1
  77. package/dist/irdevice/airconditioner.d.ts +2 -1
  78. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  79. package/dist/irdevice/airconditioner.js.map +1 -1
  80. package/dist/irdevice/airpurifier.d.ts +2 -1
  81. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  82. package/dist/irdevice/airpurifier.js.map +1 -1
  83. package/dist/irdevice/camera.d.ts +2 -1
  84. package/dist/irdevice/camera.d.ts.map +1 -1
  85. package/dist/irdevice/camera.js.map +1 -1
  86. package/dist/irdevice/fan.d.ts +2 -1
  87. package/dist/irdevice/fan.d.ts.map +1 -1
  88. package/dist/irdevice/fan.js.map +1 -1
  89. package/dist/irdevice/irdevice.d.ts +2 -1
  90. package/dist/irdevice/irdevice.d.ts.map +1 -1
  91. package/dist/irdevice/irdevice.js +1 -1
  92. package/dist/irdevice/irdevice.js.map +1 -1
  93. package/dist/irdevice/light.d.ts +2 -1
  94. package/dist/irdevice/light.d.ts.map +1 -1
  95. package/dist/irdevice/light.js.map +1 -1
  96. package/dist/irdevice/other.d.ts +2 -1
  97. package/dist/irdevice/other.d.ts.map +1 -1
  98. package/dist/irdevice/other.js.map +1 -1
  99. package/dist/irdevice/tv.d.ts +2 -1
  100. package/dist/irdevice/tv.d.ts.map +1 -1
  101. package/dist/irdevice/tv.js.map +1 -1
  102. package/dist/irdevice/vacuumcleaner.d.ts +2 -1
  103. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  104. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  105. package/dist/irdevice/waterheater.d.ts +2 -1
  106. package/dist/irdevice/waterheater.d.ts.map +1 -1
  107. package/dist/irdevice/waterheater.js.map +1 -1
  108. package/dist/platform.d.ts +5 -7
  109. package/dist/platform.d.ts.map +1 -1
  110. package/dist/platform.js +51 -34
  111. package/dist/platform.js.map +1 -1
  112. package/dist/settings.d.ts +49 -191
  113. package/dist/settings.d.ts.map +1 -1
  114. package/dist/settings.js +19 -0
  115. package/dist/settings.js.map +1 -1
  116. package/dist/types/bledevicestatus.d.ts +279 -0
  117. package/dist/types/bledevicestatus.d.ts.map +1 -0
  118. package/dist/types/bledevicestatus.js +2 -0
  119. package/dist/types/bledevicestatus.js.map +1 -0
  120. package/dist/types/devicelist.d.ts +89 -0
  121. package/dist/types/devicelist.d.ts.map +1 -0
  122. package/dist/types/devicelist.js +6 -0
  123. package/dist/types/devicelist.js.map +1 -0
  124. package/dist/types/deviceresponse.d.ts +13 -0
  125. package/dist/types/deviceresponse.d.ts.map +1 -0
  126. package/dist/types/deviceresponse.js +2 -0
  127. package/dist/types/deviceresponse.js.map +1 -0
  128. package/dist/types/devicestatus.d.ts +149 -0
  129. package/dist/types/devicestatus.d.ts.map +1 -0
  130. package/dist/types/devicestatus.js +3 -0
  131. package/dist/types/devicestatus.js.map +1 -0
  132. package/dist/types/devicewebhookstatus.d.ts +156 -0
  133. package/dist/types/devicewebhookstatus.d.ts.map +1 -0
  134. package/dist/types/devicewebhookstatus.js +2 -0
  135. package/dist/types/devicewebhookstatus.js.map +1 -0
  136. package/dist/types/irdevicelist.d.ts +10 -0
  137. package/dist/types/irdevicelist.d.ts.map +1 -0
  138. package/dist/types/irdevicelist.js +2 -0
  139. package/dist/types/irdevicelist.js.map +1 -0
  140. package/dist/types/pushbody.d.ts +6 -0
  141. package/dist/types/pushbody.d.ts.map +1 -0
  142. package/dist/types/pushbody.js +2 -0
  143. package/dist/types/pushbody.js.map +1 -0
  144. package/dist/utils.d.ts +25 -0
  145. package/dist/utils.d.ts.map +1 -1
  146. package/dist/utils.js +28 -0
  147. package/dist/utils.js.map +1 -1
  148. package/package.json +10 -10
  149. package/src/device/blindtilt.ts +223 -263
  150. package/src/device/bot.ts +208 -221
  151. package/src/device/ceilinglight.ts +210 -257
  152. package/src/device/colorbulb.ts +334 -397
  153. package/src/device/contact.ts +111 -146
  154. package/src/device/curtain.ts +220 -283
  155. package/src/device/device.ts +194 -245
  156. package/src/device/fan.ts +214 -230
  157. package/src/device/hub.ts +126 -246
  158. package/src/device/humidifier.ts +216 -243
  159. package/src/device/iosensor.ts +114 -166
  160. package/src/device/lightstrip.ts +302 -377
  161. package/src/device/lock.ts +187 -221
  162. package/src/device/meter.ts +116 -177
  163. package/src/device/meterplus.ts +117 -174
  164. package/src/device/motion.ts +99 -144
  165. package/src/device/plug.ts +110 -128
  166. package/src/device/robotvacuumcleaner.ts +189 -252
  167. package/src/device/waterdetector.ts +120 -138
  168. package/src/irdevice/airconditioner.ts +2 -1
  169. package/src/irdevice/airpurifier.ts +2 -1
  170. package/src/irdevice/camera.ts +2 -1
  171. package/src/irdevice/fan.ts +2 -1
  172. package/src/irdevice/irdevice.ts +3 -2
  173. package/src/irdevice/light.ts +2 -1
  174. package/src/irdevice/other.ts +2 -1
  175. package/src/irdevice/tv.ts +2 -1
  176. package/src/irdevice/vacuumcleaner.ts +2 -1
  177. package/src/irdevice/waterheater.ts +2 -1
  178. package/src/platform.ts +52 -34
  179. package/src/settings.ts +30 -239
  180. package/src/types/bledevicestatus.ts +305 -0
  181. package/src/types/devicelist.ts +124 -0
  182. package/src/types/deviceresponse.ts +15 -0
  183. package/src/types/devicestatus.ts +178 -0
  184. package/src/types/devicewebhookstatus.ts +196 -0
  185. package/src/types/irdevicelist.ts +15 -0
  186. package/src/types/pushbody.ts +9 -0
  187. package/src/utils.ts +33 -0
@@ -1,6 +1,7 @@
1
1
  import { deviceBase } from './device.js';
2
2
  import { convertUnits } from '../utils.js';
3
3
  import { Subject, interval, skipWhile } from 'rxjs';
4
+ import { SwitchBotBLEModel, SwitchBotBLEModelName } from 'node-switchbot';
4
5
  export class Hub extends deviceBase {
5
6
  platform;
6
7
  // Services
@@ -105,51 +106,61 @@ export class Hub extends deviceBase {
105
106
  this.refreshStatus();
106
107
  // Retrieve initial values and update Homekit
107
108
  this.updateHomeKitCharacteristics();
109
+ //regisiter webhook event handler
110
+ this.registerWebhook();
108
111
  // Start an update interval
109
112
  interval(this.deviceRefreshRate * 1000)
110
113
  .pipe(skipWhile(() => this.hubUpdateInProgress))
111
114
  .subscribe(async () => {
112
115
  await this.refreshStatus();
113
116
  });
114
- //regisiter webhook event handler
115
- this.registerWebhook(accessory, device);
116
117
  }
117
118
  async BLEparseStatus(serviceData) {
118
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BLEparseStatus`);
119
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} serviceData: ${JSON.stringify(serviceData)}`);
119
+ await this.debugLog('BLEparseStatus');
120
+ // CurrentTemperature
121
+ if (!this.device.hub?.hide_temperature && this.TemperatureSensor?.Service) {
122
+ this.TemperatureSensor.CurrentTemperature = serviceData.temperature;
123
+ await this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`);
124
+ }
125
+ // CurrentRelativeHumidity
126
+ if (!this.device.hub?.hide_humidity && this.HumiditySensor?.Service) {
127
+ this.HumiditySensor.CurrentRelativeHumidity = Number(serviceData.humidity);
128
+ await this.debugLog(`CurrentRelativeHumidity: ${this.HumiditySensor.CurrentRelativeHumidity}%`);
129
+ }
130
+ // CurrentAmbientLightLevel
131
+ if (!this.device.hub?.hide_lightsensor && this.LightSensor?.Service) {
132
+ const set_minLux = this.device.blindTilt?.set_minLux ?? 1;
133
+ const set_maxLux = this.device.blindTilt?.set_maxLux ?? 6001;
134
+ const lightLevel = Number(serviceData.lightLevel);
135
+ this.LightSensor.CurrentAmbientLightLevel = await this.getLightLevel(lightLevel, set_minLux, set_maxLux, 19);
136
+ await this.debugLog(`LightLevel: ${serviceData.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
137
+ }
120
138
  }
121
139
  async openAPIparseStatus(deviceStatus) {
122
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIparseStatus`);
140
+ await this.debugLog('openAPIparseStatus');
123
141
  // CurrentRelativeHumidity
124
- if (!this.device.hub?.hide_humidity) {
125
- this.HumiditySensor.CurrentRelativeHumidity = Number(deviceStatus.body.humidity);
126
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Humidity: ${this.HumiditySensor.CurrentRelativeHumidity}%`);
142
+ if (!this.device.hub?.hide_humidity && this.HumiditySensor?.Service) {
143
+ this.HumiditySensor.CurrentRelativeHumidity = deviceStatus.humidity;
144
+ await this.debugLog(`CurrentRelativeHumidity: ${this.HumiditySensor.CurrentRelativeHumidity}%`);
127
145
  }
128
146
  // CurrentTemperature
129
- if (!this.device.hub?.hide_temperature) {
130
- this.TemperatureSensor.CurrentTemperature = Number(deviceStatus.body.temperature);
131
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Temperature: ${this.TemperatureSensor.CurrentTemperature}°c`);
132
- }
133
- // Brightness
134
- if (!this.device.hub?.hide_lightsensor) {
135
- if (!this.device.curtain?.hide_lightsensor) {
136
- const set_minLux = this.device.curtain?.set_minLux ?? 1;
137
- const set_maxLux = this.device.curtain?.set_maxLux ?? 6001;
138
- const spaceBetweenLevels = 19;
139
- const lightLevel = deviceStatus.body.lightLevel;
140
- await this.getLightLevel(lightLevel, set_minLux, set_maxLux, spaceBetweenLevels);
141
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${deviceStatus.body.lightLevel},`
142
- + ` CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
143
- }
144
- if (!this.device.hub?.hide_lightsensor) {
145
- this.LightSensor.Service.setCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, this.LightSensor.CurrentAmbientLightLevel);
146
- }
147
+ if (!this.device.hub?.hide_temperature && this.TemperatureSensor?.Service) {
148
+ this.TemperatureSensor.CurrentTemperature = deviceStatus.temperature;
149
+ await this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`);
150
+ }
151
+ // LightSensor
152
+ if (!this.device.hub?.hide_lightsensor && this.LightSensor?.Service) {
153
+ const set_minLux = this.device.blindTilt?.set_minLux ?? 1;
154
+ const set_maxLux = this.device.blindTilt?.set_maxLux ?? 6001;
155
+ const lightLevel = Number(deviceStatus.lightLevel);
156
+ this.LightSensor.CurrentAmbientLightLevel = await this.getLightLevel(lightLevel, set_minLux, set_maxLux, 19);
157
+ await this.debugLog(`LightLevel: ${deviceStatus.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
147
158
  }
148
159
  // Firmware Version
149
- const version = deviceStatus.body.version?.toString();
150
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Firmware Version: ${version?.replace(/^V|-.*$/g, '')}`);
151
- if (deviceStatus.body.version) {
152
- const deviceVersion = version?.replace(/^V|-.*$/g, '') ?? '0.0.0';
160
+ const version = deviceStatus.version.toString();
161
+ await this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`);
162
+ if (deviceStatus.version) {
163
+ const deviceVersion = version.replace(/^V|-.*$/g, '') ?? '0.0.0';
153
164
  this.accessory
154
165
  .getService(this.hap.Service.AccessoryInformation)
155
166
  .setCharacteristic(this.hap.Characteristic.HardwareRevision, deviceVersion)
@@ -157,7 +168,34 @@ export class Hub extends deviceBase {
157
168
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
158
169
  .updateValue(deviceVersion);
159
170
  this.accessory.context.deviceVersion = deviceVersion;
160
- this.debugSuccessLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceVersion: ${this.accessory.context.deviceVersion}`);
171
+ await this.debugSuccessLog(`deviceVersion: ${this.accessory.context.deviceVersion}`);
172
+ }
173
+ }
174
+ async parseStatusWebhook(context) {
175
+ await this.debugLog('parseStatusWebhook');
176
+ await this.debugLog(`(scale, temperature, humidity, lightLevel) = Webhook:(${context.scale}, ${convertUnits(context.temperature, context.scale, this.device.hub?.convertUnitTo)}, ${context.humidity}, ${context.lightLevel}), current:(${this.TemperatureSensor?.CurrentTemperature},`
177
+ + ` ${this.HumiditySensor?.CurrentRelativeHumidity}, ${this.LightSensor?.CurrentAmbientLightLevel})`);
178
+ // Check if the scale is not CELSIUS
179
+ if (context.scale !== 'CELSIUS' && this.device.hub?.convertUnitTo === undefined) {
180
+ await this.warnLog(`received a non-CELSIUS Webhook scale: ${context.scale}, Use the *convertUnitsTo* config under Hub settings,`
181
+ + ' if displaying incorrectly in HomeKit.');
182
+ }
183
+ // CurrentRelativeHumidity
184
+ if (!this.device.hub?.hide_humidity && this.HumiditySensor?.Service) {
185
+ this.HumiditySensor.CurrentRelativeHumidity = context.humidity;
186
+ await this.debugLog(`CurrentRelativeHumidity: ${this.HumiditySensor.CurrentRelativeHumidity}`);
187
+ }
188
+ // CurrentTemperature
189
+ if (!this.device.hub?.hide_temperature && this.TemperatureSensor?.Service) {
190
+ this.TemperatureSensor.CurrentTemperature = convertUnits(context.temperature, context.scale, this.device.hub?.convertUnitTo);
191
+ await this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}`);
192
+ }
193
+ // CurrentAmbientLightLevel
194
+ if (!this.device.hub?.hide_lightsensor && this.LightSensor?.Service) {
195
+ const set_minLux = this.device.blindTilt?.set_minLux ?? 1;
196
+ const set_maxLux = this.device.blindTilt?.set_maxLux ?? 6001;
197
+ this.LightSensor.CurrentAmbientLightLevel = await this.getLightLevel(context.lightLevel, set_minLux, set_maxLux, 19);
198
+ await this.debugLog(`CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
161
199
  }
162
200
  }
163
201
  /**
@@ -165,7 +203,7 @@ export class Hub extends deviceBase {
165
203
  */
166
204
  async refreshStatus() {
167
205
  if (!this.device.enableCloudService && this.OpenAPI) {
168
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus enableCloudService: ${this.device.enableCloudService}`);
206
+ await this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`);
169
207
  }
170
208
  else if (this.BLE) {
171
209
  await this.BLERefreshStatus();
@@ -175,12 +213,11 @@ export class Hub extends deviceBase {
175
213
  }
176
214
  else {
177
215
  await this.offlineOff();
178
- this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} Connection Type:`
179
- + ` ${this.device.connectionType}, refreshStatus will not happen.`);
216
+ await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`);
180
217
  }
181
218
  }
182
219
  async BLERefreshStatus() {
183
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BLERefreshStatus`);
220
+ await this.debugLog('BLERefreshStatus');
184
221
  const switchbot = await this.switchbotBLE();
185
222
  if (switchbot === undefined) {
186
223
  await this.BLERefreshConnection(switchbot);
@@ -191,266 +228,104 @@ export class Hub extends deviceBase {
191
228
  // Start to monitor advertisement packets
192
229
  const serviceData = await this.monitorAdvertisementPackets(switchbot);
193
230
  // Update HomeKit
194
- if (serviceData.model !== '' && serviceData.modelName !== '') {
231
+ if (serviceData.model === SwitchBotBLEModel.Hub2 && serviceData.modelName === SwitchBotBLEModelName.Hub2) {
195
232
  await this.BLEparseStatus(serviceData);
196
233
  await this.updateHomeKitCharacteristics();
197
234
  }
198
235
  else {
199
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} failed to get serviceData, serviceData: ${serviceData}`);
236
+ await this.errorLog(`failed to get serviceData, serviceData: ${serviceData}`);
200
237
  await this.BLERefreshConnection(switchbot);
201
238
  }
202
239
  })();
203
240
  }
204
241
  }
205
242
  async openAPIRefreshStatus() {
206
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
243
+ await this.debugLog('openAPIRefreshStatus');
207
244
  try {
208
245
  const { body, statusCode } = await this.deviceRefreshStatus();
209
246
  const deviceStatus = await body.json();
210
- await this.refreshStatusCodes(statusCode, deviceStatus);
247
+ await this.debugLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
211
248
  ;
212
- if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
213
- await this.successfulRefreshStatus(statusCode, deviceStatus);
214
- await this.openAPIparseStatus(deviceStatus);
249
+ if (await this.successfulStatusCodes(statusCode, deviceStatus)) {
250
+ await this.debugSuccessLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
251
+ await this.openAPIparseStatus(deviceStatus.body);
215
252
  await this.updateHomeKitCharacteristics();
216
253
  }
217
254
  else {
218
- await this.statusCodes(statusCode, deviceStatus);
255
+ await this.debugWarnLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
256
+ await this.debugWarnLog(statusCode, deviceStatus);
219
257
  }
220
258
  }
221
259
  catch (e) {
222
260
  await this.apiError(e);
223
- await this.openAPIRefreshError(e);
261
+ await this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
224
262
  }
225
263
  }
226
- async registerWebhook(accessory, device) {
227
- if (device.webhook) {
228
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} is listening webhook.`);
264
+ async registerWebhook() {
265
+ if (this.device.webhook) {
266
+ await this.debugLog('is listening webhook.');
229
267
  this.platform.webhookEventHandler[this.device.deviceId] = async (context) => {
230
268
  try {
231
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} received Webhook: ${JSON.stringify(context)}`);
232
- const { temperature, humidity, lightLevel } = context;
233
- const { CurrentTemperature } = this.TemperatureSensor || { CurrentTemperature: undefined };
234
- const { CurrentAmbientLightLevel } = this.LightSensor || { CurrentAmbientLightLevel: undefined };
235
- const { CurrentRelativeHumidity } = this.HumiditySensor || { CurrentRelativeHumidity: undefined };
236
- if (context.scale !== 'CELCIUS' && device.hub?.convertUnitTo === undefined) {
237
- this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} received a non-CELCIUS Webhook scale: `
238
- + `${context.scale}, Use the *convertUnitsTo* config under Hub settings, if displaying incorrectly in HomeKit.`);
239
- }
240
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} ` +
241
- '(scale, temperature, humidity, lightLevel) = ' +
242
- `Webhook:(${context.scale}, ${convertUnits(temperature, context.scale, device.hub?.convertUnitTo)}, ${humidity}, ${lightLevel}), `
243
- + `current:(${CurrentTemperature}, ${CurrentRelativeHumidity}, ${CurrentAmbientLightLevel})`);
244
- if (!this.device.hub?.hide_humidity) {
245
- this.HumiditySensor.CurrentRelativeHumidity = humidity;
246
- }
247
- if (!this.device.hub?.hide_temperature) {
248
- this.TemperatureSensor.CurrentTemperature = convertUnits(temperature, context.scale, device.hub?.convertUnitTo);
249
- }
250
- if (!this.device.hub?.hide_lightsensor) {
251
- const set_minLux = this.device.curtain?.set_minLux ?? 1;
252
- const set_maxLux = this.device.curtain?.set_maxLux ?? 6001;
253
- const spaceBetweenLevels = 19;
254
- await this.getLightLevel(lightLevel, set_minLux, set_maxLux, spaceBetweenLevels);
255
- }
256
- this.updateHomeKitCharacteristics();
269
+ await this.debugLog(`received Webhook: ${JSON.stringify(context)}`);
270
+ await this.parseStatusWebhook(context);
271
+ await this.updateHomeKitCharacteristics();
257
272
  }
258
273
  catch (e) {
259
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
260
- + `failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e}`);
274
+ await this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e}`);
261
275
  }
262
276
  };
263
277
  }
278
+ else {
279
+ await this.debugLog('is not listening webhook.');
280
+ }
264
281
  }
265
282
  /**
266
283
  * Handle requests to set the value of the "Target Position" characteristic
267
284
  */
268
285
  async updateHomeKitCharacteristics() {
269
- const mqttmessage = [];
270
- const entry = { time: Math.round(new Date().valueOf() / 1000) };
271
286
  // CurrentRelativeHumidity
272
- if (!this.device.hub?.hide_humidity) {
273
- if (this.HumiditySensor.CurrentRelativeHumidity === undefined) {
274
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
275
- + ` CurrentRelativeHumidity: ${this.HumiditySensor.CurrentRelativeHumidity}`);
276
- }
277
- else {
278
- if (this.device.mqttURL) {
279
- mqttmessage.push(`"humidity": ${this.HumiditySensor.CurrentRelativeHumidity}`);
280
- }
281
- if (this.device.history) {
282
- entry['humidity'] = this.HumiditySensor.CurrentRelativeHumidity;
283
- }
284
- this.accessory.context.CurrentRelativeHumidity = this.HumiditySensor.CurrentRelativeHumidity;
285
- this.HumiditySensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity, this.HumiditySensor.CurrentRelativeHumidity);
286
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
287
- + `updateCharacteristic CurrentRelativeHumidity: ${this.HumiditySensor.CurrentRelativeHumidity}`);
288
- }
287
+ if (!this.device.hub?.hide_humidity && this.HumiditySensor?.Service) {
288
+ await this.updateCharacteristic(this.HumiditySensor.Service, this.hap.Characteristic.CurrentRelativeHumidity, this.HumiditySensor.CurrentRelativeHumidity, 'CurrentRelativeHumidity');
289
289
  }
290
290
  // CurrentTemperature
291
- if (!this.device.hub?.hide_temperature) {
292
- if (this.TemperatureSensor.CurrentTemperature === undefined) {
293
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}`);
294
- }
295
- else {
296
- if (this.device.mqttURL) {
297
- mqttmessage.push(`"temperature": ${this.TemperatureSensor.CurrentTemperature}`);
298
- }
299
- if (this.device.history) {
300
- entry['temp'] = this.TemperatureSensor.CurrentTemperature;
301
- }
302
- this.accessory.context.CurrentTemperature = this.TemperatureSensor.CurrentTemperature;
303
- this.TemperatureSensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, this.TemperatureSensor.CurrentTemperature);
304
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
305
- + ` CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}`);
306
- }
291
+ if (!this.device.hub?.hide_temperature && this.TemperatureSensor?.Service) {
292
+ await this.updateCharacteristic(this.TemperatureSensor.Service, this.hap.Characteristic.CurrentTemperature, this.TemperatureSensor.CurrentTemperature, 'CurrentTemperature');
307
293
  }
308
294
  // CurrentAmbientLightLevel
309
- if (!this.device.hub?.hide_lightsensor) {
310
- if (this.LightSensor.CurrentAmbientLightLevel === undefined) {
311
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
312
- + ` CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
313
- }
314
- else {
315
- if (this.device.mqttURL) {
316
- mqttmessage.push(`"light": ${this.LightSensor.CurrentAmbientLightLevel}`);
317
- }
318
- if (this.device.history) {
319
- entry['lux'] = this.LightSensor.CurrentAmbientLightLevel;
320
- }
321
- this.accessory.context.CurrentAmbientLightLevel = this.LightSensor.CurrentAmbientLightLevel;
322
- this.LightSensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, this.LightSensor.CurrentAmbientLightLevel);
323
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
324
- + `updateCharacteristic CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
325
- }
326
- }
327
- // MQTT
328
- if (this.device.mqttURL) {
329
- this.mqttPublish(`{${mqttmessage.join(',')}}`);
330
- }
331
- if (Number(this.HumiditySensor.CurrentRelativeHumidity) > 0) {
332
- // reject unreliable data
333
- if (this.device.history) {
334
- this.historyService?.addEntry(entry);
335
- }
295
+ if (!this.device.hub?.hide_lightsensor && this.LightSensor?.Service) {
296
+ await this.updateCharacteristic(this.LightSensor.Service, this.hap.Characteristic.CurrentAmbientLightLevel, this.LightSensor.CurrentAmbientLightLevel, 'CurrentAmbientLightLevel');
336
297
  }
337
298
  }
338
299
  async BLERefreshConnection(switchbot) {
339
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot:`
340
- + ` ${JSON.stringify(switchbot)}`);
300
+ await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${JSON.stringify(switchbot)}`);
341
301
  if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
342
- this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
302
+ await this.warnLog('Using OpenAPI Connection to Refresh Status');
343
303
  await this.openAPIRefreshStatus();
344
304
  }
345
305
  }
346
306
  async offlineOff() {
347
307
  if (this.device.offline) {
348
- if (!this.device.hub?.hide_temperature) {
308
+ if (!this.device.hub?.hide_temperature && this.TemperatureSensor?.Service) {
349
309
  this.TemperatureSensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, this.accessory.context.CurrentTemperature);
350
310
  }
351
- if (!this.device.hub?.hide_humidity) {
311
+ if (!this.device.hub?.hide_humidity && this.HumiditySensor?.Service) {
352
312
  this.HumiditySensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity, this.accessory.context.CurrentRelativeHumidity);
353
313
  }
354
- if (!this.device.hub?.hide_lightsensor) {
314
+ if (!this.device.hub?.hide_lightsensor && this.LightSensor?.Service) {
355
315
  this.LightSensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, this.accessory.context.CurrentAmbientLightLevel);
356
316
  }
357
317
  }
358
318
  }
359
319
  async apiError(e) {
360
- if (!this.device.hub?.hide_temperature) {
320
+ if (!this.device.hub?.hide_temperature && this.TemperatureSensor?.Service) {
361
321
  this.TemperatureSensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, e);
362
322
  }
363
- if (!this.device.hub?.hide_humidity) {
323
+ if (!this.device.hub?.hide_humidity && this.HumiditySensor?.Service) {
364
324
  this.HumiditySensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity, e);
365
325
  }
366
- if (!this.device.hub?.hide_lightsensor) {
326
+ if (!this.device.hub?.hide_lightsensor && this.LightSensor?.Service) {
367
327
  this.LightSensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, e);
368
328
  }
369
329
  }
370
- async getLightLevel(lightLevel, set_minLux, set_maxLux, spaceBetweenLevels) {
371
- switch (lightLevel) {
372
- case 1:
373
- this.LightSensor.CurrentAmbientLightLevel = set_minLux;
374
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
375
- break;
376
- case 2:
377
- this.LightSensor.CurrentAmbientLightLevel = (set_maxLux - set_minLux) / spaceBetweenLevels;
378
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel},`
379
- + ` Calculation: ${(set_maxLux - set_minLux) / spaceBetweenLevels}`);
380
- break;
381
- case 3:
382
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 2;
383
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
384
- break;
385
- case 4:
386
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 3;
387
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
388
- break;
389
- case 5:
390
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 4;
391
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
392
- break;
393
- case 6:
394
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 5;
395
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
396
- break;
397
- case 7:
398
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 6;
399
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
400
- break;
401
- case 8:
402
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 7;
403
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
404
- break;
405
- case 9:
406
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 8;
407
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
408
- break;
409
- case 10:
410
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 9;
411
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
412
- break;
413
- case 11:
414
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 10;
415
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
416
- break;
417
- case 12:
418
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 11;
419
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
420
- break;
421
- case 13:
422
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 12;
423
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
424
- break;
425
- case 14:
426
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 13;
427
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
428
- break;
429
- case 15:
430
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 14;
431
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
432
- break;
433
- case 16:
434
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 15;
435
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
436
- break;
437
- case 17:
438
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 16;
439
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
440
- break;
441
- case 18:
442
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 17;
443
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
444
- break;
445
- case 19:
446
- this.LightSensor.CurrentAmbientLightLevel = ((set_maxLux - set_minLux) / spaceBetweenLevels) * 18;
447
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
448
- break;
449
- case 20:
450
- default:
451
- this.LightSensor.CurrentAmbientLightLevel = set_maxLux;
452
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} LightLevel: ${lightLevel}`);
453
- }
454
- }
455
330
  }
456
331
  //# sourceMappingURL=hub.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hub.js","sourceRoot":"","sources":["../../src/device/hub.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAMpD,MAAM,OAAO,GAAI,SAAQ,UAAU;IAyBtB;IAxBX,WAAW;IACH,WAAW,CAIjB;IAEM,cAAc,CAIpB;IAEM,iBAAiB,CAIvB;IAEF,UAAU;IACV,mBAAmB,CAAW;IAC9B,WAAW,CAAiB;IAE5B,YACW,QAA2B,EACpC,SAA4B,EAC5B,MAA8B;QAE9B,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAJ1B,aAAQ,GAAR,QAAQ,CAAmB;QAKpC,oFAAoF;QACpF,IAAI,CAAC,WAAW,GAAG,IAAI,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QAEjC,wCAAwC;QACxC,IAAI,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,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4
+ import type { device } from '../types/devicelist.js';
3
5
  import type { SwitchBotPlatform } from '../platform.js';
6
+ import type { humidifierServiceData } from '../types/bledevicestatus.js';
7
+ import type { humidifierStatus } from '../types/devicestatus.js';
8
+ import type { humidifierWebhookContext } from '../types/devicewebhookstatus.js';
4
9
  import type { PlatformAccessory, CharacteristicValue } from 'homebridge';
5
- import type { device, devicesConfig, serviceData, deviceStatus } from '../settings.js';
6
10
  /**
7
11
  * Platform Accessory
8
12
  * An instance of this class is created for each accessory your platform registers
@@ -15,12 +19,16 @@ export declare class Humidifier extends deviceBase {
15
19
  humidifierUpdateInProgress: boolean;
16
20
  doHumidifierUpdate: Subject<void>;
17
21
  constructor(platform: SwitchBotPlatform, accessory: PlatformAccessory, device: device & devicesConfig);
18
- BLEparseStatus(serviceData: serviceData): Promise<void>;
19
- openAPIparseStatus(deviceStatus: deviceStatus): Promise<void>;
22
+ BLEparseStatus(serviceData: humidifierServiceData): Promise<void>;
23
+ openAPIparseStatus(deviceStatus: humidifierStatus): Promise<void>;
24
+ parseStatusWebhook(context: humidifierWebhookContext): Promise<void>;
25
+ /**
26
+ * Asks the SwitchBot API for the latest device information
27
+ */
20
28
  refreshStatus(): Promise<void>;
21
29
  BLERefreshStatus(): Promise<void>;
22
30
  openAPIRefreshStatus(): Promise<void>;
23
- registerWebhook(accessory: PlatformAccessory, device: device & devicesConfig): Promise<void>;
31
+ registerWebhook(): Promise<void>;
24
32
  /**
25
33
  * Pushes the requested changes to the SwitchBot API
26
34
  */
@@ -1 +1 @@
1
- {"version":3,"file":"humidifier.d.ts","sourceRoot":"","sources":["../../src/device/humidifier.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAY,OAAO,EAAE,MAAM,MAAM,CAAC;AAIzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,M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