@switchbot/homebridge-switchbot 3.3.0-beta.0 → 3.3.0-beta.2

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 (106) hide show
  1. package/dist/device/blindtilt.d.ts.map +1 -1
  2. package/dist/device/blindtilt.js +36 -0
  3. package/dist/device/blindtilt.js.map +1 -1
  4. package/dist/device/bot.d.ts.map +1 -1
  5. package/dist/device/bot.js +36 -0
  6. package/dist/device/bot.js.map +1 -1
  7. package/dist/device/ceilinglight.d.ts.map +1 -1
  8. package/dist/device/ceilinglight.js +36 -0
  9. package/dist/device/ceilinglight.js.map +1 -1
  10. package/dist/device/colorbulb.d.ts +1 -1
  11. package/dist/device/colorbulb.d.ts.map +1 -1
  12. package/dist/device/colorbulb.js +43 -6
  13. package/dist/device/colorbulb.js.map +1 -1
  14. package/dist/device/contact.d.ts.map +1 -1
  15. package/dist/device/contact.js +36 -0
  16. package/dist/device/contact.js.map +1 -1
  17. package/dist/device/curtain.d.ts.map +1 -1
  18. package/dist/device/curtain.js +36 -0
  19. package/dist/device/curtain.js.map +1 -1
  20. package/dist/device/hub.d.ts.map +1 -1
  21. package/dist/device/hub.js +36 -0
  22. package/dist/device/hub.js.map +1 -1
  23. package/dist/device/humidifier.d.ts.map +1 -1
  24. package/dist/device/humidifier.js +36 -0
  25. package/dist/device/humidifier.js.map +1 -1
  26. package/dist/device/iosensor.d.ts.map +1 -1
  27. package/dist/device/iosensor.js +36 -0
  28. package/dist/device/iosensor.js.map +1 -1
  29. package/dist/device/lightstrip.d.ts.map +1 -1
  30. package/dist/device/lightstrip.js +36 -0
  31. package/dist/device/lightstrip.js.map +1 -1
  32. package/dist/device/lock.d.ts.map +1 -1
  33. package/dist/device/lock.js +36 -0
  34. package/dist/device/lock.js.map +1 -1
  35. package/dist/device/meter.d.ts.map +1 -1
  36. package/dist/device/meter.js +36 -0
  37. package/dist/device/meter.js.map +1 -1
  38. package/dist/device/meterplus.d.ts.map +1 -1
  39. package/dist/device/meterplus.js +36 -0
  40. package/dist/device/meterplus.js.map +1 -1
  41. package/dist/device/motion.d.ts.map +1 -1
  42. package/dist/device/motion.js +36 -0
  43. package/dist/device/motion.js.map +1 -1
  44. package/dist/device/plug.d.ts.map +1 -1
  45. package/dist/device/plug.js +36 -0
  46. package/dist/device/plug.js.map +1 -1
  47. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  48. package/dist/device/robotvacuumcleaner.js +36 -0
  49. package/dist/device/robotvacuumcleaner.js.map +1 -1
  50. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  51. package/dist/irdevice/airconditioner.js +36 -0
  52. package/dist/irdevice/airconditioner.js.map +1 -1
  53. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  54. package/dist/irdevice/airpurifier.js +36 -0
  55. package/dist/irdevice/airpurifier.js.map +1 -1
  56. package/dist/irdevice/camera.d.ts.map +1 -1
  57. package/dist/irdevice/camera.js +36 -0
  58. package/dist/irdevice/camera.js.map +1 -1
  59. package/dist/irdevice/fan.d.ts.map +1 -1
  60. package/dist/irdevice/fan.js +36 -0
  61. package/dist/irdevice/fan.js.map +1 -1
  62. package/dist/irdevice/light.d.ts.map +1 -1
  63. package/dist/irdevice/light.js +36 -0
  64. package/dist/irdevice/light.js.map +1 -1
  65. package/dist/irdevice/other.d.ts.map +1 -1
  66. package/dist/irdevice/other.js +36 -0
  67. package/dist/irdevice/other.js.map +1 -1
  68. package/dist/irdevice/tv.d.ts.map +1 -1
  69. package/dist/irdevice/tv.js +36 -0
  70. package/dist/irdevice/tv.js.map +1 -1
  71. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  72. package/dist/irdevice/vacuumcleaner.js +36 -0
  73. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  74. package/dist/irdevice/waterheater.d.ts.map +1 -1
  75. package/dist/irdevice/waterheater.js +36 -0
  76. package/dist/irdevice/waterheater.js.map +1 -1
  77. package/dist/platform.d.ts.map +1 -1
  78. package/dist/platform.js +37 -6
  79. package/dist/platform.js.map +1 -1
  80. package/package.json +1 -1
  81. package/src/device/blindtilt.ts +36 -0
  82. package/src/device/bot.ts +36 -0
  83. package/src/device/ceilinglight.ts +36 -0
  84. package/src/device/colorbulb.ts +43 -6
  85. package/src/device/contact.ts +36 -0
  86. package/src/device/curtain.ts +36 -0
  87. package/src/device/hub.ts +36 -0
  88. package/src/device/humidifier.ts +36 -0
  89. package/src/device/iosensor.ts +36 -0
  90. package/src/device/lightstrip.ts +36 -0
  91. package/src/device/lock.ts +36 -0
  92. package/src/device/meter.ts +36 -0
  93. package/src/device/meterplus.ts +36 -0
  94. package/src/device/motion.ts +36 -0
  95. package/src/device/plug.ts +36 -0
  96. package/src/device/robotvacuumcleaner.ts +36 -0
  97. package/src/irdevice/airconditioner.ts +36 -0
  98. package/src/irdevice/airpurifier.ts +36 -0
  99. package/src/irdevice/camera.ts +36 -0
  100. package/src/irdevice/fan.ts +36 -0
  101. package/src/irdevice/light.ts +36 -0
  102. package/src/irdevice/other.ts +36 -0
  103. package/src/irdevice/tv.ts +36 -0
  104. package/src/irdevice/vacuumcleaner.ts +36 -0
  105. package/src/irdevice/waterheater.ts +36 -0
  106. package/src/platform.ts +37 -6
@@ -747,6 +747,42 @@ export class RobotVacuumCleaner {
747
747
  case 200:
748
748
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
749
749
  break;
750
+ case 400:
751
+ this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
752
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
753
+ break;
754
+ case 401:
755
+ this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
756
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
757
+ break;
758
+ case 403:
759
+ this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
760
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
761
+ break;
762
+ case 404:
763
+ this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
764
+ + `statusCode: ${statusCode}`);
765
+ break;
766
+ case 406:
767
+ this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
768
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
769
+ break;
770
+ case 415:
771
+ this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
772
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
773
+ break;
774
+ case 422:
775
+ this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, `
776
+ + `but the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
777
+ break;
778
+ case 429:
779
+ this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
780
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
781
+ break;
782
+ case 500:
783
+ this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
784
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
785
+ break;
750
786
  default:
751
787
  this.infoLog(
752
788
  `${this.device.deviceType}: ${this.accessory.displayName} Unknown statusCode: ` +
@@ -610,6 +610,42 @@ export class AirConditioner {
610
610
  case 200:
611
611
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
612
612
  break;
613
+ case 400:
614
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
615
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
616
+ break;
617
+ case 401:
618
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
619
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
620
+ break;
621
+ case 403:
622
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
623
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
624
+ break;
625
+ case 404:
626
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
627
+ + `statusCode: ${statusCode}`);
628
+ break;
629
+ case 406:
630
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
631
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
632
+ break;
633
+ case 415:
634
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
635
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
636
+ break;
637
+ case 422:
638
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
639
+ + `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
640
+ break;
641
+ case 429:
642
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
643
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
644
+ break;
645
+ case 500:
646
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
647
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
648
+ break;
613
649
  default:
614
650
  this.infoLog(
615
651
  `${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
@@ -357,6 +357,42 @@ export class AirPurifier {
357
357
  case 200:
358
358
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
359
359
  break;
360
+ case 400:
361
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
362
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
363
+ break;
364
+ case 401:
365
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
366
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
367
+ break;
368
+ case 403:
369
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
370
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
371
+ break;
372
+ case 404:
373
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
374
+ + `statusCode: ${statusCode}`);
375
+ break;
376
+ case 406:
377
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
378
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
379
+ break;
380
+ case 415:
381
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
382
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
383
+ break;
384
+ case 422:
385
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
386
+ + `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
387
+ break;
388
+ case 429:
389
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
390
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
391
+ break;
392
+ case 500:
393
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
394
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
395
+ break;
360
396
  default:
361
397
  this.infoLog(
362
398
  `${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
@@ -241,6 +241,42 @@ export class Camera {
241
241
  case 200:
242
242
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
243
243
  break;
244
+ case 400:
245
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
246
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
247
+ break;
248
+ case 401:
249
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
250
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
251
+ break;
252
+ case 403:
253
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
254
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
255
+ break;
256
+ case 404:
257
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
258
+ + `statusCode: ${statusCode}`);
259
+ break;
260
+ case 406:
261
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
262
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
263
+ break;
264
+ case 415:
265
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
266
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
267
+ break;
268
+ case 422:
269
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
270
+ + `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
271
+ break;
272
+ case 429:
273
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
274
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
275
+ break;
276
+ case 500:
277
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
278
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
279
+ break;
244
280
  default:
245
281
  this.infoLog(
246
282
  `${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
@@ -371,6 +371,42 @@ export class Fan {
371
371
  case 200:
372
372
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
373
373
  break;
374
+ case 400:
375
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
376
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
377
+ break;
378
+ case 401:
379
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
380
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
381
+ break;
382
+ case 403:
383
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
384
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
385
+ break;
386
+ case 404:
387
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
388
+ + `statusCode: ${statusCode}`);
389
+ break;
390
+ case 406:
391
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
392
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
393
+ break;
394
+ case 415:
395
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
396
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
397
+ break;
398
+ case 422:
399
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
400
+ + `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
401
+ break;
402
+ case 429:
403
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
404
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
405
+ break;
406
+ case 500:
407
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
408
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
409
+ break;
374
410
  default:
375
411
  this.infoLog(
376
412
  `${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
@@ -382,6 +382,42 @@ export class Light {
382
382
  case 200:
383
383
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
384
384
  break;
385
+ case 400:
386
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
387
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
388
+ break;
389
+ case 401:
390
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
391
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
392
+ break;
393
+ case 403:
394
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
395
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
396
+ break;
397
+ case 404:
398
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
399
+ + `statusCode: ${statusCode}`);
400
+ break;
401
+ case 406:
402
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
403
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
404
+ break;
405
+ case 415:
406
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
407
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
408
+ break;
409
+ case 422:
410
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
411
+ + `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
412
+ break;
413
+ case 429:
414
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
415
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
416
+ break;
417
+ case 500:
418
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
419
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
420
+ break;
385
421
  default:
386
422
  this.infoLog(
387
423
  `${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
@@ -727,6 +727,42 @@ export class Others {
727
727
  case 200:
728
728
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
729
729
  break;
730
+ case 400:
731
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
732
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
733
+ break;
734
+ case 401:
735
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
736
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
737
+ break;
738
+ case 403:
739
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
740
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
741
+ break;
742
+ case 404:
743
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
744
+ + `statusCode: ${statusCode}`);
745
+ break;
746
+ case 406:
747
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
748
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
749
+ break;
750
+ case 415:
751
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
752
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
753
+ break;
754
+ case 422:
755
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
756
+ + `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
757
+ break;
758
+ case 429:
759
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
760
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
761
+ break;
762
+ case 500:
763
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
764
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
765
+ break;
730
766
  default:
731
767
  this.infoLog(
732
768
  `${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
@@ -506,6 +506,42 @@ export class TV {
506
506
  case 200:
507
507
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
508
508
  break;
509
+ case 400:
510
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
511
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
512
+ break;
513
+ case 401:
514
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
515
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
516
+ break;
517
+ case 403:
518
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
519
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
520
+ break;
521
+ case 404:
522
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
523
+ + `statusCode: ${statusCode}`);
524
+ break;
525
+ case 406:
526
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
527
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
528
+ break;
529
+ case 415:
530
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
531
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
532
+ break;
533
+ case 422:
534
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
535
+ + `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
536
+ break;
537
+ case 429:
538
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
539
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
540
+ break;
541
+ case 500:
542
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
543
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
544
+ break;
509
545
  default:
510
546
  this.infoLog(
511
547
  `${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
@@ -237,6 +237,42 @@ export class VacuumCleaner {
237
237
  case 200:
238
238
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
239
239
  break;
240
+ case 400:
241
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
242
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
243
+ break;
244
+ case 401:
245
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
246
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
247
+ break;
248
+ case 403:
249
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
250
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
251
+ break;
252
+ case 404:
253
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
254
+ + `statusCode: ${statusCode}`);
255
+ break;
256
+ case 406:
257
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
258
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
259
+ break;
260
+ case 415:
261
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
262
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
263
+ break;
264
+ case 422:
265
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
266
+ + `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
267
+ break;
268
+ case 429:
269
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
270
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
271
+ break;
272
+ case 500:
273
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
274
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
275
+ break;
240
276
  default:
241
277
  this.infoLog(
242
278
  `${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
@@ -246,6 +246,42 @@ export class WaterHeater {
246
246
  case 200:
247
247
  this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
248
248
  break;
249
+ case 400:
250
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Bad Request, The client has issued an invalid request. `
251
+ + `This is commonly used to specify validation errors in a request payload, statusCode: ${statusCode}`);
252
+ break;
253
+ case 401:
254
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unauthorized, Authorization for the API is required, `
255
+ + `but the request has not been authenticated, statusCode: ${statusCode}`);
256
+ break;
257
+ case 403:
258
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Forbidden, The request has been authenticated but does not `
259
+ + `have appropriate permissions, or a requested resource is not found, statusCode: ${statusCode}`);
260
+ break;
261
+ case 404:
262
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Found, Specifies the requested path does not exist, `
263
+ + `statusCode: ${statusCode}`);
264
+ break;
265
+ case 406:
266
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Not Acceptable, The client has requested a MIME type via `
267
+ + `the Accept header for a value not supported by the server, statusCode: ${statusCode}`);
268
+ break;
269
+ case 415:
270
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unsupported Media Type, The client has defined a contentType `
271
+ + `header that is not supported by the server, statusCode: ${statusCode}`);
272
+ break;
273
+ case 422:
274
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Unprocessable Entity, The client has made a valid request, but `
275
+ + `the server cannot process it. This is often used for APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
276
+ break;
277
+ case 429:
278
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Too Many Requests, The client has exceeded the number of `
279
+ + `requests allowed for a given time window, statusCode: ${statusCode}`);
280
+ break;
281
+ case 500:
282
+ this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Internal Server Error, An unexpected error on the SmartThings `
283
+ + `servers has occurred. These errors should be rare, statusCode: ${statusCode}`);
284
+ break;
249
285
  default:
250
286
  this.infoLog(
251
287
  `${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode: ` +
package/src/platform.ts CHANGED
@@ -2514,6 +2514,41 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
2514
2514
  case 200:
2515
2515
  this.debugLog(`Request successful, statusCode: ${statusCode}`);
2516
2516
  break;
2517
+ case 400:
2518
+ this.errorLog('Bad Request, The client has issued an invalid request. This is commonly used to specify validation errors in a request '
2519
+ + `payload, statusCode: ${statusCode}`);
2520
+ break;
2521
+ case 401:
2522
+ this.errorLog('Unauthorized, Authorization for the API is required, but the request has not been authenticated, '
2523
+ + `statusCode: ${statusCode}`);
2524
+ break;
2525
+ case 403:
2526
+ this.errorLog('Forbidden, The request has been authenticated but does not have appropriate permissions, or a requested resource is not '
2527
+ + `found, statusCode: ${statusCode}`);
2528
+ break;
2529
+ case 404:
2530
+ this.errorLog(`Not Found, Specifies the requested path does not exist, statusCode: ${statusCode}`);
2531
+ break;
2532
+ case 406:
2533
+ this.errorLog('Not Acceptable, The client has requested a MIME type via the Accept header for a value not supported by the server, '
2534
+ + `statusCode: ${statusCode}`);
2535
+ break;
2536
+ case 415:
2537
+ this.errorLog('Unsupported Media Type, The client has defined a contentType header that is not supported by the server, '
2538
+ + `statusCode: ${statusCode}`);
2539
+ break;
2540
+ case 422:
2541
+ this.errorLog('Unprocessable Entity, The client has made a valid request, but the server cannot process it. This is often used for '
2542
+ + `APIs for which certain limits have been exceeded, statusCode: ${statusCode}`);
2543
+ break;
2544
+ case 429:
2545
+ this.errorLog('Too Many Requests, The client has exceeded the number of requests allowed for a given time window, '
2546
+ + `statusCode: ${statusCode}`);
2547
+ break;
2548
+ case 500:
2549
+ this.errorLog('Internal Server Error, An unexpected error on the SmartThings servers has occurred. These errors should be rare, '
2550
+ + `statusCode: ${statusCode}`);
2551
+ break;
2517
2552
  default:
2518
2553
  this.errorLog(`Unknown statusCode, statusCode: ${statusCode}, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug`);
2519
2554
  }
@@ -2521,14 +2556,10 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
2521
2556
 
2522
2557
  // BLE Connection
2523
2558
  async connectBLE() {
2524
- let noble: any;
2525
- let SwitchBot: any;
2526
2559
  let switchbot: any;
2527
2560
  try {
2528
- noble = (await import('@abandonware/noble')).default;
2529
- SwitchBot = (await import('node-switchbot')).default;
2530
- //SwitchBot = (await import('/Users/Shared/GitHub/OpenWonderLabs/node-switchbot/dist/switchbot.js')).default;
2531
- queueScheduler.schedule(() => (switchbot = new SwitchBot({ 'noble': noble })));
2561
+ const SwitchBot = (await import('node-switchbot')).SwitchBot;
2562
+ queueScheduler.schedule(() => (switchbot = new SwitchBot()));
2532
2563
  } catch (e: any) {
2533
2564
  switchbot = false;
2534
2565
  this.errorLog(`Was 'node-switchbot' found: ${switchbot}, Error: ${e}`);