@switchbot/homebridge-switchbot 2.4.1-beta.7 → 2.5.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/config.schema.json +5 -1
- package/dist/device/blindtilt.d.ts +9 -8
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +114 -150
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +2 -0
- package/dist/device/curtain.js.map +1 -1
- package/dist/settings.d.ts +24 -18
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +8 -8
- package/src/device/blindtilt.ts +119 -160
- package/src/device/curtain.ts +2 -0
- package/src/settings.ts +39 -64
package/src/settings.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
1
2
|
import { MacAddress, PlatformConfig } from 'homebridge';
|
|
2
3
|
import { IClientOptions } from 'async-mqtt';
|
|
3
4
|
/**
|
|
@@ -229,70 +230,44 @@ export type irdevice = {
|
|
|
229
230
|
};
|
|
230
231
|
|
|
231
232
|
export type deviceStatus = {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
shakeRange?: string;
|
|
271
|
-
//only available for Motion Sensor, Contact Sensor devices. determines if motion is detected
|
|
272
|
-
moveDetected?: boolean;
|
|
273
|
-
//only available for Motion Sensor, Contact Sensor devices. tell the ambient environment is bright or dim
|
|
274
|
-
//only available for Color Bulb/Strip Light devices. the brightness value, range from 1 to 100
|
|
275
|
-
brightness?: string | number;
|
|
276
|
-
//only available for Contact Sensor devices. open/close/timeOutNotClose
|
|
277
|
-
openState?: string;
|
|
278
|
-
//only available for Color Bulb/Strip Light devices. the color value, RGB "255:255:255"
|
|
279
|
-
color?: string;
|
|
280
|
-
//only available for Color Bulb devices. the color temperature value, range from 2700 to 6500
|
|
281
|
-
colorTemperature?: number;
|
|
282
|
-
//only available for Humidifier devices. determines if the water tank empty or not
|
|
283
|
-
lackWater?: boolean;
|
|
284
|
-
//only available for Plug Mini (US)/Plug Mini (JP). Current voltage of the device (Unit: V).
|
|
285
|
-
voltage: number;
|
|
286
|
-
//only available for Plug Mini (US)/Plug Mini (JP). The power consumption of the device for the day (Unit: W/min).
|
|
287
|
-
weight: number;
|
|
288
|
-
//only available for Plug Mini (US)/Plug Mini (JP). How long the device has been used for the day (Unit: min).
|
|
289
|
-
electricityOfDay: number;
|
|
290
|
-
//only available for Plug Mini (US)/Plug Mini (JP). Current current of the device (Unit: A).
|
|
291
|
-
electricCurrent: number;
|
|
292
|
-
//only available for Lock devices. determines if the lock is locked or not.
|
|
293
|
-
lockState: string;
|
|
294
|
-
//only available for Lock devices. determines if the door is closed or not.
|
|
295
|
-
doorState: string;
|
|
233
|
+
//v1.1 of API
|
|
234
|
+
deviceId: string; //device ID. (Used by the following deviceTypes: Bot, Curtain, Meter, Meter Plus, Lock, Keypad, Keypad Touch, Motion Sensor, Contact Sensor, Ceiling Light, Ceiling Light Pro, Plug Mini (US), Plug Mini (JP), Strip Light, Color Bulb, Robot Vacuum Cleaner S1, Robot Vacuum Cleaner S1 Plus, Humidifier, Blind Tilt)
|
|
235
|
+
deviceType: string; //device type. (Used by the following deviceTypes: Bot, Curtain, Meter, Meter Plus, Lock, Keypad, Keypad Touch, Motion Sensor, Contact Sensor, Ceiling Light, Ceiling Light Pro, Plug Mini (US), Plug Mini (JP), Strip Light, Color Bulb, Robot Vacuum Cleaner S1, Robot Vacuum Cleaner S1 Plus, Humidifier, Blind Tilt)
|
|
236
|
+
hubDeviceId: string; //device's parent Hub ID. 000000000000 when the device itself is a Hub or it is connected through Wi-Fi. (Used by the following deviceTypes: Bot, Curtain, Meter, Meter Plus, Lock, Keypad, Keypad Touch, Motion Sensor, Contact Sensor, Ceiling Light, Ceiling Light Pro, Plug Mini (JP), Strip Light, Color Bulb, Robot Vacuum Cleaner S1, Robot Vacuum Cleaner S1 Plus, Humidifier, Blind Tilt)
|
|
237
|
+
power?: string; //ON/OFF state. (Used by the following deviceTypes: Bot, Ceiling Light, Ceiling Light Pro, PLug, Plug Mini (US), Plug Mini (JP), Strip Light, Color Bulb, Humidifier)
|
|
238
|
+
calibrate?: boolean; //determines if device has been calibrated or not. (Used by the following deviceTypes: Curtain, Lock, Blind Tilt)
|
|
239
|
+
group?: boolean; //determines if a device is paired with or grouped with another device or not. (Used by the following deviceTypes: Curtain, Blind Tilt)
|
|
240
|
+
moving?: boolean; //determines if a device is moving or not. (Used by the following deviceTypes: Curtain, Blind Tilt)
|
|
241
|
+
slidePosition?: number;//the current position (0-100) the percentage of the distance between the calibrated open position and closed position. (Used by the following deviceTypes: Curtain, Blind Tilt)
|
|
242
|
+
temperature?: number; //temperature in celsius (Used by the following deviceTypes: Meter, Meter Plus, Humidifier)
|
|
243
|
+
humidity?: number; //humidity percentage. (Used by the following deviceTypes: Meter, Meter Plus, Humidifier)
|
|
244
|
+
lockState?: string; //determines if locked or not. (Used by the following deviceTypes: Lock)
|
|
245
|
+
doorState?: string; //determines if the door is closed or not. (Used by the following deviceTypes: Lock)
|
|
246
|
+
moveDetected?: boolean; //determines if motion is detected. (Used by the following deviceTypes: Motion Sensor, Contact Sensor)
|
|
247
|
+
brightness?: string | number; //the ambient brightness picked up by the sensor. bright or dim. (Used by the following deviceTypes: Motion Sensor, Contact Sensor) | the brightness value, range from 1 to 100. (Used by the following deviceTypes: Ceiling Light, Ceiling Light Pro, Strip Light, Color Bulb)
|
|
248
|
+
openState?: string; //the open state of the sensor. open, close, or timeOutNotClose. (Used by the following deviceTypes: Contact Sensor)
|
|
249
|
+
colorTemperature?: number; //the color temperature value, range from 2700 to 6500. (Used by the following deviceTypes: Ceiling Light, Ceiling Light Pro, Color Bulb)
|
|
250
|
+
voltage?: number; //the voltage of the device, measured in Volt. (Used by the following deviceTypes: Plug Mini (US), Plug Mini (JP))
|
|
251
|
+
weight?: number; //the power consumed in a day, measured in Watts. (Used by the following deviceTypes: Plug Mini (US), Plug Mini (JP))
|
|
252
|
+
electricityOfDay?: number; //the duration that the device has been used during a day, measured in minutes. (Used by the following deviceTypes: Plug Mini (US), Plug Mini (JP))
|
|
253
|
+
electricCurrent?: number; //the current of the device at the moment, measured in Amp. (Used by the following deviceTypes: Plug Mini (US), Plug Mini (JP))
|
|
254
|
+
color?: string; //the color value, RGB "255:255:255". (Used by the following deviceTypes: Strip Light, Color Bulb)
|
|
255
|
+
workingStatus?: string; //the working status of the device. StandBy, Clearing, Paused, GotoChargeBase, Charging, ChargeDone, Dormant, InTrouble, InRemoteControl, or InDustCollecting. (Used by the following deviceTypes: Robot Vacuum Cleaner S1, Robot Vacuum Cleaner S1 Plus)
|
|
256
|
+
onlineStatus?: string; //the connection status of the device. online or offline. (Used by the following deviceTypes: Robot Vacuum Cleaner S1, Robot Vacuum Cleaner S1 Plus)
|
|
257
|
+
battery?: number; //the current battery level. (Used by the following deviceTypes: Robot Vacuum Cleaner S1, Robot Vacuum Cleaner S1 Plus, Blind Tilt)
|
|
258
|
+
deviceName?: string; //device name. (Used by the following deviceTypes: Robot Vacuum Cleaner S1 Plus)
|
|
259
|
+
nebulizationEfficiency?: number; //atomization efficiency percentage. (Used by the following deviceTypes: Humidifier)
|
|
260
|
+
auto?: boolean; //determines if a Humidifier is in Auto Mode or not. (Used by the following deviceTypes: Humidifier)
|
|
261
|
+
childLock?: boolean; //determines if a Humidifier's safety lock is on or not. (Used by the following deviceTypes: Humidifier)
|
|
262
|
+
sound?: boolean; //determines if a Humidifier is muted or not. (Used by the following deviceTypes: Humidifier)
|
|
263
|
+
lackWater?: boolean; //determines if the water tank is empty or not. (Used by the following deviceTypes: Humidifier)
|
|
264
|
+
version?: number; // the version of the device. (Used by the following deviceTypes: Blind Tilt)
|
|
265
|
+
direction?: string; //the opening direction of a Blind Tilt device. (Used by the following deviceTypes: Blind Tilt)
|
|
266
|
+
mode?: number; //available for devices. the fan mode. (Used by the following deviceTypes: Smart Fan)
|
|
267
|
+
speed?: number;//the fan speed. (Used by the following deviceTypes: Smart Fan)
|
|
268
|
+
shaking?: boolean; //determines if the fan is swinging or not. (Used by the following deviceTypes: Smart Fan)
|
|
269
|
+
shakeCenter?: string;//only available for Smart Fan devices. the fan's swing direciton. (Used by the following deviceTypes: Smart Fan)
|
|
270
|
+
shakeRange?: string;//only available for Smart Fan devices. the fan's swing range, 0~120°. (Used by the following deviceTypes: Smart Fan)
|
|
296
271
|
};
|
|
297
272
|
|
|
298
273
|
export type ad = {
|