@switchbot/homebridge-switchbot 2.8.1-beta.15 → 2.8.1-beta.17

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/src/platform.ts CHANGED
@@ -302,13 +302,13 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
302
302
  });
303
303
  this.debugWarnLog(`body: ${JSON.stringify(body)}`);
304
304
  this.debugWarnLog(`statusCode: ${statusCode}`);
305
- this.debugWarnLog(`headers: ${headers}`);
305
+ this.debugWarnLog(`headers: ${JSON.stringify(headers)}`);
306
306
  const devicesAPI: any = await body.json();
307
307
  this.debugWarnLog(`devicesAPI: ${JSON.stringify(devicesAPI)}`);
308
- this.debugWarnLog(`devicesAPI Length: ${devicesAPI.length}`);
309
308
  this.debugWarnLog(`devicesAPI Body: ${JSON.stringify(devicesAPI.body)}`);
310
309
  this.debugWarnLog(`devicesAPI StatusCode: ${devicesAPI.statusCode}`);
311
- if ((devicesAPI === 200 || devicesAPI === 100) && (devicesAPI.statusCode === 200 || devicesAPI.statusCode === 100)) {
310
+ if ((statusCode === 200 || statusCode === 100) && (devicesAPI.statusCode === 200 || devicesAPI.statusCode === 100)) {
311
+ this.debugErrorLog(`statusCode: ${statusCode} & devicesAPI StatusCode: ${devicesAPI.statusCode}`);
312
312
  // SwitchBot Devices
313
313
  const deviceLists = devicesAPI.body.deviceList;
314
314
  this.debugWarnLog(`DeviceLists: ${JSON.stringify(deviceLists)}`);
@@ -399,6 +399,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
399
399
  this.debugLog(`Total IR Devices Found: ${devicesAPI.body.infraredRemoteList.length}`);
400
400
  }
401
401
  } else {
402
+ this.statusCode(statusCode);
402
403
  this.statusCode(devicesAPI.statusCode);
403
404
  }
404
405
  } catch (e: any) {