@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.
- package/.github/npm-version-script.cjs +81 -0
- package/CHANGELOG.md +8 -0
- package/config.schema.json +41 -0
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +36 -0
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +36 -0
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +36 -0
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +43 -6
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +36 -0
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +36 -0
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +36 -0
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +36 -0
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +36 -0
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +36 -0
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +36 -0
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +36 -0
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +36 -0
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +36 -0
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +36 -0
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +36 -0
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +4 -0
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +76 -4
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +36 -0
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +36 -0
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +36 -0
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +36 -0
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +36 -0
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +36 -0
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +36 -0
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +36 -0
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +35 -0
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +4 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +36 -0
- package/src/device/bot.ts +36 -0
- package/src/device/ceilinglight.ts +36 -0
- package/src/device/colorbulb.ts +43 -6
- package/src/device/contact.ts +36 -0
- package/src/device/curtain.ts +36 -0
- package/src/device/hub.ts +36 -0
- package/src/device/humidifier.ts +36 -0
- package/src/device/iosensor.ts +36 -0
- package/src/device/lightstrip.ts +36 -0
- package/src/device/lock.ts +36 -0
- package/src/device/meter.ts +36 -0
- package/src/device/meterplus.ts +36 -0
- package/src/device/motion.ts +36 -0
- package/src/device/plug.ts +36 -0
- package/src/device/robotvacuumcleaner.ts +36 -0
- package/src/irdevice/airconditioner.ts +74 -4
- package/src/irdevice/airpurifier.ts +36 -0
- package/src/irdevice/camera.ts +36 -0
- package/src/irdevice/fan.ts +36 -0
- package/src/irdevice/light.ts +36 -0
- package/src/irdevice/other.ts +36 -0
- package/src/irdevice/tv.ts +36 -0
- package/src/irdevice/vacuumcleaner.ts +36 -0
- package/src/irdevice/waterheater.ts +36 -0
- package/src/platform.ts +35 -0
- 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;
|
|
193
|
-
set_max?: number;
|
|
194
|
-
set_min?: number;
|
|
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;
|