@switchbot/homebridge-switchbot 3.2.0 → 3.3.0-beta.1

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 (114) hide show
  1. package/.github/npm-version-script.cjs +81 -0
  2. package/CHANGELOG.md +8 -0
  3. package/config.schema.json +41 -0
  4. package/dist/device/blindtilt.d.ts.map +1 -1
  5. package/dist/device/blindtilt.js +36 -0
  6. package/dist/device/blindtilt.js.map +1 -1
  7. package/dist/device/bot.d.ts.map +1 -1
  8. package/dist/device/bot.js +36 -0
  9. package/dist/device/bot.js.map +1 -1
  10. package/dist/device/ceilinglight.d.ts.map +1 -1
  11. package/dist/device/ceilinglight.js +36 -0
  12. package/dist/device/ceilinglight.js.map +1 -1
  13. package/dist/device/colorbulb.d.ts +1 -1
  14. package/dist/device/colorbulb.d.ts.map +1 -1
  15. package/dist/device/colorbulb.js +43 -6
  16. package/dist/device/colorbulb.js.map +1 -1
  17. package/dist/device/contact.d.ts.map +1 -1
  18. package/dist/device/contact.js +36 -0
  19. package/dist/device/contact.js.map +1 -1
  20. package/dist/device/curtain.d.ts.map +1 -1
  21. package/dist/device/curtain.js +36 -0
  22. package/dist/device/curtain.js.map +1 -1
  23. package/dist/device/hub.d.ts.map +1 -1
  24. package/dist/device/hub.js +36 -0
  25. package/dist/device/hub.js.map +1 -1
  26. package/dist/device/humidifier.d.ts.map +1 -1
  27. package/dist/device/humidifier.js +36 -0
  28. package/dist/device/humidifier.js.map +1 -1
  29. package/dist/device/iosensor.d.ts.map +1 -1
  30. package/dist/device/iosensor.js +36 -0
  31. package/dist/device/iosensor.js.map +1 -1
  32. package/dist/device/lightstrip.d.ts.map +1 -1
  33. package/dist/device/lightstrip.js +36 -0
  34. package/dist/device/lightstrip.js.map +1 -1
  35. package/dist/device/lock.d.ts.map +1 -1
  36. package/dist/device/lock.js +36 -0
  37. package/dist/device/lock.js.map +1 -1
  38. package/dist/device/meter.d.ts.map +1 -1
  39. package/dist/device/meter.js +36 -0
  40. package/dist/device/meter.js.map +1 -1
  41. package/dist/device/meterplus.d.ts.map +1 -1
  42. package/dist/device/meterplus.js +36 -0
  43. package/dist/device/meterplus.js.map +1 -1
  44. package/dist/device/motion.d.ts.map +1 -1
  45. package/dist/device/motion.js +36 -0
  46. package/dist/device/motion.js.map +1 -1
  47. package/dist/device/plug.d.ts.map +1 -1
  48. package/dist/device/plug.js +36 -0
  49. package/dist/device/plug.js.map +1 -1
  50. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  51. package/dist/device/robotvacuumcleaner.js +36 -0
  52. package/dist/device/robotvacuumcleaner.js.map +1 -1
  53. package/dist/irdevice/airconditioner.d.ts +4 -0
  54. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  55. package/dist/irdevice/airconditioner.js +76 -4
  56. package/dist/irdevice/airconditioner.js.map +1 -1
  57. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  58. package/dist/irdevice/airpurifier.js +36 -0
  59. package/dist/irdevice/airpurifier.js.map +1 -1
  60. package/dist/irdevice/camera.d.ts.map +1 -1
  61. package/dist/irdevice/camera.js +36 -0
  62. package/dist/irdevice/camera.js.map +1 -1
  63. package/dist/irdevice/fan.d.ts.map +1 -1
  64. package/dist/irdevice/fan.js +36 -0
  65. package/dist/irdevice/fan.js.map +1 -1
  66. package/dist/irdevice/light.d.ts.map +1 -1
  67. package/dist/irdevice/light.js +36 -0
  68. package/dist/irdevice/light.js.map +1 -1
  69. package/dist/irdevice/other.d.ts.map +1 -1
  70. package/dist/irdevice/other.js +36 -0
  71. package/dist/irdevice/other.js.map +1 -1
  72. package/dist/irdevice/tv.d.ts.map +1 -1
  73. package/dist/irdevice/tv.js +36 -0
  74. package/dist/irdevice/tv.js.map +1 -1
  75. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  76. package/dist/irdevice/vacuumcleaner.js +36 -0
  77. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  78. package/dist/irdevice/waterheater.d.ts.map +1 -1
  79. package/dist/irdevice/waterheater.js +36 -0
  80. package/dist/irdevice/waterheater.js.map +1 -1
  81. package/dist/platform.d.ts.map +1 -1
  82. package/dist/platform.js +35 -0
  83. package/dist/platform.js.map +1 -1
  84. package/dist/settings.d.ts +4 -0
  85. package/dist/settings.d.ts.map +1 -1
  86. package/dist/settings.js.map +1 -1
  87. package/package.json +1 -1
  88. package/src/device/blindtilt.ts +36 -0
  89. package/src/device/bot.ts +36 -0
  90. package/src/device/ceilinglight.ts +36 -0
  91. package/src/device/colorbulb.ts +43 -6
  92. package/src/device/contact.ts +36 -0
  93. package/src/device/curtain.ts +36 -0
  94. package/src/device/hub.ts +36 -0
  95. package/src/device/humidifier.ts +36 -0
  96. package/src/device/iosensor.ts +36 -0
  97. package/src/device/lightstrip.ts +36 -0
  98. package/src/device/lock.ts +36 -0
  99. package/src/device/meter.ts +36 -0
  100. package/src/device/meterplus.ts +36 -0
  101. package/src/device/motion.ts +36 -0
  102. package/src/device/plug.ts +36 -0
  103. package/src/device/robotvacuumcleaner.ts +36 -0
  104. package/src/irdevice/airconditioner.ts +74 -4
  105. package/src/irdevice/airpurifier.ts +36 -0
  106. package/src/irdevice/camera.ts +36 -0
  107. package/src/irdevice/fan.ts +36 -0
  108. package/src/irdevice/light.ts +36 -0
  109. package/src/irdevice/other.ts +36 -0
  110. package/src/irdevice/tv.ts +36 -0
  111. package/src/irdevice/vacuumcleaner.ts +36 -0
  112. package/src/irdevice/waterheater.ts +36 -0
  113. package/src/platform.ts +35 -0
  114. package/src/settings.ts +7 -3
@@ -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
  }
package/src/settings.ts CHANGED
@@ -189,9 +189,9 @@ export interface irDevicesConfig extends irdevice {
189
189
  export type irfan = {
190
190
  swing_mode?: boolean;
191
191
  rotation_speed?: boolean;
192
- set_minStep?: number; //set_minStep
193
- set_max?: number; //set_max
194
- set_min?: number; //set_min
192
+ set_minStep?: number;
193
+ set_max?: number;
194
+ set_min?: number;
195
195
  };
196
196
 
197
197
  export type irlight = {
@@ -200,6 +200,10 @@ export type irlight = {
200
200
 
201
201
  export type irair = {
202
202
  hide_automode?: boolean;
203
+ set_max_heat?: number;
204
+ set_min_heat?: number;
205
+ set_max_cool?: number;
206
+ set_min_cool?: number;
203
207
  meterType?: string;
204
208
  meterId?: string;
205
209
  meterUuid?: string;