node-switchbot 2.5.0-beta.0 → 2.5.0-beta.10
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/dist/advertising.d.ts +32 -15
- package/dist/advertising.d.ts.map +1 -1
- package/dist/advertising.js +72 -72
- package/dist/advertising.js.map +1 -1
- package/dist/device/woblindtilt.d.ts +19 -50
- package/dist/device/woblindtilt.d.ts.map +1 -1
- package/dist/device/woblindtilt.js +39 -98
- package/dist/device/woblindtilt.js.map +1 -1
- package/dist/device/wobulb.d.ts +41 -15
- package/dist/device/wobulb.d.ts.map +1 -1
- package/dist/device/wobulb.js +71 -127
- package/dist/device/wobulb.js.map +1 -1
- package/dist/device/woceilinglight.d.ts +47 -21
- package/dist/device/woceilinglight.d.ts.map +1 -1
- package/dist/device/woceilinglight.js +94 -169
- package/dist/device/woceilinglight.js.map +1 -1
- package/dist/device/wocontact.d.ts +11 -1
- package/dist/device/wocontact.d.ts.map +1 -1
- package/dist/device/wocontact.js +22 -21
- package/dist/device/wocontact.js.map +1 -1
- package/dist/device/wocurtain.d.ts +39 -1
- package/dist/device/wocurtain.d.ts.map +1 -1
- package/dist/device/wocurtain.js +68 -102
- package/dist/device/wocurtain.js.map +1 -1
- package/dist/device/wohand.d.ts +37 -2
- package/dist/device/wohand.d.ts.map +1 -1
- package/dist/device/wohand.js +54 -88
- package/dist/device/wohand.js.map +1 -1
- package/dist/device/wohub2.d.ts +11 -1
- package/dist/device/wohub2.d.ts.map +1 -1
- package/dist/device/wohub2.js +22 -22
- package/dist/device/wohub2.js.map +1 -1
- package/dist/device/wohumi.d.ts +37 -2
- package/dist/device/wohumi.d.ts.map +1 -1
- package/dist/device/wohumi.js +51 -82
- package/dist/device/wohumi.js.map +1 -1
- package/dist/device/woiosensorth.d.ts +12 -1
- package/dist/device/woiosensorth.d.ts.map +1 -1
- package/dist/device/woiosensorth.js +26 -22
- package/dist/device/woiosensorth.js.map +1 -1
- package/dist/device/woplugmini.d.ts +45 -12
- package/dist/device/woplugmini.d.ts.map +1 -1
- package/dist/device/woplugmini.js +69 -75
- package/dist/device/woplugmini.js.map +1 -1
- package/dist/device/wopresence.d.ts +11 -1
- package/dist/device/wopresence.d.ts.map +1 -1
- package/dist/device/wopresence.js +20 -26
- package/dist/device/wopresence.js.map +1 -1
- package/dist/device/wosensorth.d.ts +18 -2
- package/dist/device/wosensorth.d.ts.map +1 -1
- package/dist/device/wosensorth.js +34 -40
- package/dist/device/wosensorth.js.map +1 -1
- package/dist/device/wosmartlock.d.ts +56 -13
- package/dist/device/wosmartlock.d.ts.map +1 -1
- package/dist/device/wosmartlock.js +106 -194
- package/dist/device/wosmartlock.js.map +1 -1
- package/dist/device/wosmartlockpro.d.ts +61 -18
- package/dist/device/wosmartlockpro.d.ts.map +1 -1
- package/dist/device/wosmartlockpro.js +114 -203
- package/dist/device/wosmartlockpro.js.map +1 -1
- package/dist/device/wostrip.d.ts +37 -18
- package/dist/device/wostrip.d.ts.map +1 -1
- package/dist/device/wostrip.js +78 -124
- package/dist/device/wostrip.js.map +1 -1
- package/dist/device.d.ts +86 -223
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +123 -407
- package/dist/device.js.map +1 -1
- package/dist/parameter-checker.d.ts +78 -18
- package/dist/parameter-checker.d.ts.map +1 -1
- package/dist/parameter-checker.js +139 -334
- package/dist/parameter-checker.js.map +1 -1
- package/dist/settings.d.ts +23 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +23 -2
- package/dist/settings.js.map +1 -1
- package/dist/switchbot.d.ts +67 -34
- package/dist/switchbot.d.ts.map +1 -1
- package/dist/switchbot.js +186 -367
- package/dist/switchbot.js.map +1 -1
- package/dist/test/woblindtilt.test.d.ts.map +1 -0
- package/dist/test/woblindtilt.test.js +93 -0
- package/dist/test/woblindtilt.test.js.map +1 -0
- package/dist/{device → test}/wobulb.test.d.ts.map +1 -1
- package/dist/test/wobulb.test.js +100 -0
- package/dist/test/wobulb.test.js.map +1 -0
- package/dist/test/woceilinglight.test.d.ts.map +1 -0
- package/dist/test/woceilinglight.test.js +91 -0
- package/dist/test/woceilinglight.test.js.map +1 -0
- package/dist/test/wocontact.test.d.ts.map +1 -0
- package/dist/test/wocontact.test.js +34 -0
- package/dist/test/wocontact.test.js.map +1 -0
- package/dist/test/wocurtain.test.d.ts.map +1 -0
- package/dist/test/wocurtain.test.js +72 -0
- package/dist/test/wocurtain.test.js.map +1 -0
- package/dist/{device → test}/wohand.test.d.ts.map +1 -1
- package/dist/test/wohand.test.js +72 -0
- package/dist/test/wohand.test.js.map +1 -0
- package/dist/test/wohub2.test.d.ts +2 -0
- package/dist/test/wohub2.test.d.ts.map +1 -0
- package/dist/{device/wohand2.test.js → test/wohub2.test.js} +6 -4
- package/dist/test/wohub2.test.js.map +1 -0
- package/dist/{device → test}/wohumi.test.d.ts.map +1 -1
- package/dist/{device → test}/wohumi.test.js +1 -2
- package/dist/test/wohumi.test.js.map +1 -0
- package/dist/test/woiosensorth.test.d.ts.map +1 -0
- package/dist/{device → test}/woiosensorth.test.js +7 -5
- package/dist/test/woiosensorth.test.js.map +1 -0
- package/dist/test/woplugmini.test.d.ts.map +1 -0
- package/dist/{device → test}/woplugmini.test.js +6 -5
- package/dist/test/woplugmini.test.js.map +1 -0
- package/dist/test/wopresence.test.d.ts.map +1 -0
- package/dist/{device → test}/wopresence.test.js +1 -1
- package/dist/test/wopresence.test.js.map +1 -0
- package/dist/test/wosensorth.test.d.ts.map +1 -0
- package/dist/{device → test}/wosensorth.test.js +3 -4
- package/dist/test/wosensorth.test.js.map +1 -0
- package/dist/test/wosmartlock.test.d.ts.map +1 -0
- package/dist/test/wosmartlock.test.js +143 -0
- package/dist/test/wosmartlock.test.js.map +1 -0
- package/dist/test/wosmartlockpro.test.d.ts.map +1 -0
- package/dist/{device → test}/wosmartlockpro.test.js +26 -26
- package/dist/test/wosmartlockpro.test.js.map +1 -0
- package/dist/{device → test}/wostrip.test.d.ts.map +1 -1
- package/dist/{device → test}/wostrip.test.js +18 -19
- package/dist/test/wostrip.test.js.map +1 -0
- package/dist/types/types.d.ts +52 -120
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/device/woblindtilt.test.d.ts.map +0 -1
- package/dist/device/woblindtilt.test.js +0 -26
- package/dist/device/woblindtilt.test.js.map +0 -1
- package/dist/device/wobulb.test.js +0 -52
- package/dist/device/wobulb.test.js.map +0 -1
- package/dist/device/woceilinglight.test.d.ts.map +0 -1
- package/dist/device/woceilinglight.test.js +0 -63
- package/dist/device/woceilinglight.test.js.map +0 -1
- package/dist/device/wocontact.test.d.ts.map +0 -1
- package/dist/device/wocontact.test.js +0 -34
- package/dist/device/wocontact.test.js.map +0 -1
- package/dist/device/wocurtain.test.d.ts.map +0 -1
- package/dist/device/wocurtain.test.js +0 -33
- package/dist/device/wocurtain.test.js.map +0 -1
- package/dist/device/wohand.test.js +0 -62
- package/dist/device/wohand.test.js.map +0 -1
- package/dist/device/wohand2.test.d.ts +0 -2
- package/dist/device/wohand2.test.d.ts.map +0 -1
- package/dist/device/wohand2.test.js.map +0 -1
- package/dist/device/wohumi.test.js.map +0 -1
- package/dist/device/woiosensorth.test.d.ts.map +0 -1
- package/dist/device/woiosensorth.test.js.map +0 -1
- package/dist/device/woplugmini.test.d.ts.map +0 -1
- package/dist/device/woplugmini.test.js.map +0 -1
- package/dist/device/wopresence.test.d.ts.map +0 -1
- package/dist/device/wopresence.test.js.map +0 -1
- package/dist/device/wosensorth.test.d.ts.map +0 -1
- package/dist/device/wosensorth.test.js.map +0 -1
- package/dist/device/wosmartlock.test.d.ts.map +0 -1
- package/dist/device/wosmartlock.test.js +0 -84
- package/dist/device/wosmartlock.test.js.map +0 -1
- package/dist/device/wosmartlockpro.test.d.ts.map +0 -1
- package/dist/device/wosmartlockpro.test.js.map +0 -1
- package/dist/device/wostrip.test.js.map +0 -1
- /package/dist/{device → test}/woblindtilt.test.d.ts +0 -0
- /package/dist/{device → test}/wobulb.test.d.ts +0 -0
- /package/dist/{device → test}/woceilinglight.test.d.ts +0 -0
- /package/dist/{device → test}/wocontact.test.d.ts +0 -0
- /package/dist/{device → test}/wocurtain.test.d.ts +0 -0
- /package/dist/{device → test}/wohand.test.d.ts +0 -0
- /package/dist/{device → test}/wohumi.test.d.ts +0 -0
- /package/dist/{device → test}/woiosensorth.test.d.ts +0 -0
- /package/dist/{device → test}/woplugmini.test.d.ts +0 -0
- /package/dist/{device → test}/wopresence.test.d.ts +0 -0
- /package/dist/{device → test}/wosensorth.test.d.ts +0 -0
- /package/dist/{device → test}/wosmartlock.test.d.ts +0 -0
- /package/dist/{device → test}/wosmartlockpro.test.d.ts +0 -0
- /package/dist/{device → test}/wostrip.test.d.ts +0 -0
package/dist/settings.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Switchbot BLE API registration settings.
|
|
3
|
+
*
|
|
4
|
+
* © 2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
5
|
+
*/
|
|
1
6
|
export declare const SERV_UUID_PRIMARY = "cba20d00224d11e69fb80002a5d5c51b";
|
|
2
7
|
export declare const CHAR_UUID_WRITE = "cba20002224d11e69fb80002a5d5c51b";
|
|
3
8
|
export declare const CHAR_UUID_NOTIFY = "cba20003224d11e69fb80002a5d5c51b";
|
|
@@ -5,4 +10,22 @@ export declare const CHAR_UUID_DEVICE = "2a00";
|
|
|
5
10
|
export declare const READ_TIMEOUT_MSEC = 3000;
|
|
6
11
|
export declare const WRITE_TIMEOUT_MSEC = 3000;
|
|
7
12
|
export declare const COMMAND_TIMEOUT_MSEC = 3000;
|
|
13
|
+
export declare enum WoSmartLockProCommands {
|
|
14
|
+
GET_CKIV = "570f2103",
|
|
15
|
+
LOCK_INFO = "570f4f8102",
|
|
16
|
+
UNLOCK = "570f4e0101000080",
|
|
17
|
+
UNLOCK_NO_UNLATCH = "570f4e01010000a0",
|
|
18
|
+
LOCK = "570f4e0101000000",
|
|
19
|
+
ENABLE_NOTIFICATIONS = "570e01001e00008101",
|
|
20
|
+
DISABLE_NOTIFICATIONS = "570e00"
|
|
21
|
+
}
|
|
22
|
+
export declare enum WoSmartLockCommands {
|
|
23
|
+
GET_CKIV = "570f2103",
|
|
24
|
+
LOCK_INFO = "570f4f8101",
|
|
25
|
+
UNLOCK = "570f4e01011080",
|
|
26
|
+
UNLOCK_NO_UNLATCH = "570f4e010110a0",
|
|
27
|
+
LOCK = "570f4e01011000",
|
|
28
|
+
ENABLE_NOTIFICATIONS = "570e01001e00008101",
|
|
29
|
+
DISABLE_NOTIFICATIONS = "570e00"
|
|
30
|
+
}
|
|
8
31
|
//# sourceMappingURL=settings.d.ts.map
|
package/dist/settings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,iBAAiB,qCAAqC,CAAA;AACnE,eAAO,MAAM,eAAe,qCAAqC,CAAA;AACjE,eAAO,MAAM,gBAAgB,qCAAqC,CAAA;AAClE,eAAO,MAAM,gBAAgB,SAAS,CAAA;AAEtC,eAAO,MAAM,iBAAiB,OAAO,CAAA;AACrC,eAAO,MAAM,kBAAkB,OAAO,CAAA;AACtC,eAAO,MAAM,oBAAoB,OAAO,CAAA;AAExC,oBAAY,sBAAsB;IAChC,QAAQ,aAAa;IACrB,SAAS,eAAe;IACxB,MAAM,qBAAqB;IAC3B,iBAAiB,qBAAqB;IACtC,IAAI,qBAAqB;IACzB,oBAAoB,uBAAuB;IAC3C,qBAAqB,WAAW;CACjC;AAED,oBAAY,mBAAmB;IAC7B,QAAQ,aAAa;IACrB,SAAS,eAAe;IACxB,MAAM,mBAAmB;IACzB,iBAAiB,mBAAmB;IACpC,IAAI,mBAAmB;IACvB,oBAAoB,uBAAuB;IAC3C,qBAAqB,WAAW;CACjC"}
|
package/dist/settings.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Switchbot BLE API registration settings.
|
|
2
3
|
*
|
|
3
|
-
*
|
|
4
|
+
* © 2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
4
5
|
*/
|
|
5
6
|
export const SERV_UUID_PRIMARY = 'cba20d00224d11e69fb80002a5d5c51b';
|
|
6
7
|
export const CHAR_UUID_WRITE = 'cba20002224d11e69fb80002a5d5c51b';
|
|
@@ -9,4 +10,24 @@ export const CHAR_UUID_DEVICE = '2a00';
|
|
|
9
10
|
export const READ_TIMEOUT_MSEC = 3000;
|
|
10
11
|
export const WRITE_TIMEOUT_MSEC = 3000;
|
|
11
12
|
export const COMMAND_TIMEOUT_MSEC = 3000;
|
|
13
|
+
export var WoSmartLockProCommands;
|
|
14
|
+
(function (WoSmartLockProCommands) {
|
|
15
|
+
WoSmartLockProCommands["GET_CKIV"] = "570f2103";
|
|
16
|
+
WoSmartLockProCommands["LOCK_INFO"] = "570f4f8102";
|
|
17
|
+
WoSmartLockProCommands["UNLOCK"] = "570f4e0101000080";
|
|
18
|
+
WoSmartLockProCommands["UNLOCK_NO_UNLATCH"] = "570f4e01010000a0";
|
|
19
|
+
WoSmartLockProCommands["LOCK"] = "570f4e0101000000";
|
|
20
|
+
WoSmartLockProCommands["ENABLE_NOTIFICATIONS"] = "570e01001e00008101";
|
|
21
|
+
WoSmartLockProCommands["DISABLE_NOTIFICATIONS"] = "570e00";
|
|
22
|
+
})(WoSmartLockProCommands || (WoSmartLockProCommands = {}));
|
|
23
|
+
export var WoSmartLockCommands;
|
|
24
|
+
(function (WoSmartLockCommands) {
|
|
25
|
+
WoSmartLockCommands["GET_CKIV"] = "570f2103";
|
|
26
|
+
WoSmartLockCommands["LOCK_INFO"] = "570f4f8101";
|
|
27
|
+
WoSmartLockCommands["UNLOCK"] = "570f4e01011080";
|
|
28
|
+
WoSmartLockCommands["UNLOCK_NO_UNLATCH"] = "570f4e010110a0";
|
|
29
|
+
WoSmartLockCommands["LOCK"] = "570f4e01011000";
|
|
30
|
+
WoSmartLockCommands["ENABLE_NOTIFICATIONS"] = "570e01001e00008101";
|
|
31
|
+
WoSmartLockCommands["DISABLE_NOTIFICATIONS"] = "570e00";
|
|
32
|
+
})(WoSmartLockCommands || (WoSmartLockCommands = {}));
|
|
12
33
|
//# sourceMappingURL=settings.js.map
|
package/dist/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,kCAAkC,CAAA;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,kCAAkC,CAAA;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kCAAkC,CAAA;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAEtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAA;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAA;AAExC,MAAM,CAAN,IAAY,sBAQX;AARD,WAAY,sBAAsB;IAChC,+CAAqB,CAAA;IACrB,kDAAwB,CAAA;IACxB,qDAA2B,CAAA;IAC3B,gEAAsC,CAAA;IACtC,mDAAyB,CAAA;IACzB,qEAA2C,CAAA;IAC3C,0DAAgC,CAAA;AAClC,CAAC,EARW,sBAAsB,KAAtB,sBAAsB,QAQjC;AAED,MAAM,CAAN,IAAY,mBAQX;AARD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,+CAAwB,CAAA;IACxB,gDAAyB,CAAA;IACzB,2DAAoC,CAAA;IACpC,8CAAuB,CAAA;IACvB,kEAA2C,CAAA;IAC3C,uDAAgC,CAAA;AAClC,CAAC,EARW,mBAAmB,KAAnB,mBAAmB,QAQ9B"}
|
package/dist/switchbot.d.ts
CHANGED
|
@@ -1,50 +1,83 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
3
|
-
import type { Params } from './types/types.js';
|
|
1
|
+
import type { Ad, Params } from './types/types.js';
|
|
2
|
+
import * as Noble from '@stoprocent/noble';
|
|
4
3
|
import { SwitchbotDevice } from './device.js';
|
|
4
|
+
/**
|
|
5
|
+
* SwitchBot class to interact with SwitchBot devices.
|
|
6
|
+
*/
|
|
5
7
|
export declare class SwitchBot {
|
|
6
8
|
private ready;
|
|
7
9
|
noble: typeof Noble;
|
|
8
10
|
ondiscover?: (device: SwitchbotDevice) => void;
|
|
9
11
|
onadvertisement?: (ad: Ad) => void;
|
|
10
|
-
onlog
|
|
12
|
+
onlog?: (message: string) => void;
|
|
11
13
|
DEFAULT_DISCOVERY_DURATION: number;
|
|
12
|
-
PRIMARY_SERVICE_UUID_LIST:
|
|
14
|
+
PRIMARY_SERVICE_UUID_LIST: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Constructor
|
|
17
|
+
*
|
|
18
|
+
* @param {Params} [params] - Optional parameters
|
|
19
|
+
* @param {typeof Noble} [params.noble] - Optional noble instance
|
|
20
|
+
*/
|
|
13
21
|
constructor(params?: Params);
|
|
22
|
+
/**
|
|
23
|
+
* Initializes the noble object.
|
|
24
|
+
*
|
|
25
|
+
* @param {Params} [params] - Optional parameters
|
|
26
|
+
* @param {typeof Noble} [params.noble] - Optional noble instance
|
|
27
|
+
* @returns {Promise<void>} - Resolves when initialization is complete
|
|
28
|
+
*/
|
|
14
29
|
init(params?: Params): Promise<void>;
|
|
15
30
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* -
|
|
26
|
-
|
|
27
|
-
* - "c": Curtains
|
|
28
|
-
* - "{": Curtain 3
|
|
29
|
-
* - "u": Color Bulbs
|
|
30
|
-
* - "g": Plugs
|
|
31
|
-
* - "o": Locks
|
|
32
|
-
* - "$": Lock Pros
|
|
33
|
-
* - "i": Meter Pluses
|
|
34
|
-
* - "r": Locks (Duplicate, possibly an error)
|
|
35
|
-
* - id: Optional device ID (MAC address) to discover, case-insensitive, ignores colons.
|
|
36
|
-
* - quick: If true, stops discovery upon first match, not waiting full duration. Defaults to false.
|
|
37
|
-
*
|
|
38
|
-
* @returns Promise resolving to an array of `SwitchbotDevice` objects for discovered devices.
|
|
39
|
-
*
|
|
40
|
-
* @deprecated since version 2.4.0. Will be removed in version 3.0.0. Use getDeviceObjectAsync() instead.
|
|
41
|
-
*/
|
|
42
|
-
discover(params?: Params): Promise<unknown>;
|
|
31
|
+
* Discover SwitchBot devices based on the provided parameters.
|
|
32
|
+
*
|
|
33
|
+
* @param {Params} params - The parameters for discovery.
|
|
34
|
+
* @returns {Promise<SwitchbotDevice[]>} - A promise that resolves with a list of discovered devices.
|
|
35
|
+
*/
|
|
36
|
+
discover(params?: Params): Promise<SwitchbotDevice[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Initializes the noble object and waits for it to be powered on.
|
|
39
|
+
*
|
|
40
|
+
* @returns {Promise<void>} - Resolves when the noble object is powered on.
|
|
41
|
+
*/
|
|
43
42
|
_init(): Promise<void>;
|
|
44
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Gets the device object based on the peripheral, id, and model.
|
|
45
|
+
*
|
|
46
|
+
* @param {Noble.Peripheral} peripheral - The peripheral object.
|
|
47
|
+
* @param {string} id - The device id.
|
|
48
|
+
* @param {string} model - The device model.
|
|
49
|
+
* @returns {Promise<SwitchbotDevice | null>} - The device object or null.
|
|
50
|
+
*/
|
|
51
|
+
getDeviceObject(peripheral: Noble.Peripheral, id: string, model: string): Promise<SwitchbotDevice | null>;
|
|
52
|
+
/**
|
|
53
|
+
* Filters advertising data based on id and model.
|
|
54
|
+
*
|
|
55
|
+
* @param {Ad} ad - The advertising data.
|
|
56
|
+
* @param {string} id - The device id.
|
|
57
|
+
* @param {string} model - The device model.
|
|
58
|
+
* @returns {boolean} - True if the advertising data matches the id and model, false otherwise.
|
|
59
|
+
*/
|
|
45
60
|
filterAdvertising(ad: Ad, id: string, model: string): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Starts scanning for SwitchBot devices.
|
|
63
|
+
*
|
|
64
|
+
* @param {Params} [params] - Optional parameters.
|
|
65
|
+
* @returns {Promise<void>} - Resolves when scanning starts successfully.
|
|
66
|
+
*/
|
|
46
67
|
startScan(params?: Params): Promise<void>;
|
|
47
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Stops scanning for SwitchBot devices.
|
|
70
|
+
*
|
|
71
|
+
* @returns {Promise<void>} - Resolves when scanning stops successfully.
|
|
72
|
+
*/
|
|
73
|
+
stopScan(): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Waits for the specified time.
|
|
76
|
+
*
|
|
77
|
+
* @param {number} msec - The time to wait in milliseconds.
|
|
78
|
+
* @returns {Promise<void>} - Resolves after the specified time.
|
|
79
|
+
*/
|
|
80
|
+
wait(msec: number): Promise<void>;
|
|
48
81
|
}
|
|
49
82
|
export { SwitchbotDevice };
|
|
50
83
|
//# sourceMappingURL=switchbot.d.ts.map
|
package/dist/switchbot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchbot.d.ts","sourceRoot":"","sources":["../src/switchbot.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"switchbot.d.ts","sourceRoot":"","sources":["../src/switchbot.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAmB7C;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAe;IAC5B,KAAK,EAAG,OAAO,KAAK,CAAA;IACpB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAA;IAC9C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,CAAA;IAClC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,0BAA0B,SAAO;IACjC,yBAAyB,EAAE,MAAM,EAAE,CAAK;IAExC;;;;;OAKG;gBACS,MAAM,CAAC,EAAE,MAAM;IAI3B;;;;;;OAMG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C;;;;;OAKG;IACG,QAAQ,CAAC,MAAM,GAAE,MAAW,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IA2D/D;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAsB5B;;;;;;;OAOG;IACG,eAAe,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAgC/G;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAoB7D;;;;;OAKG;IACG,SAAS,CAAC,MAAM,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCnD;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAS/B;;;;;OAKG;IACG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAexC;AAED,OAAO,EAAE,eAAe,EAAE,CAAA"}
|