node-switchbot 6.1.1 → 6.1.3
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/CHANGELOG.md +18 -0
- package/dist/ble.d.ts.map +1 -1
- package/dist/ble.js +21 -10
- package/dist/ble.js.map +1 -1
- package/dist/devices/index.d.ts +8 -2
- package/dist/devices/index.d.ts.map +1 -1
- package/dist/devices/index.js +4 -2
- package/dist/devices/index.js.map +1 -1
- package/dist/devices/wo-art-frame2.d.ts +65 -0
- package/dist/devices/wo-art-frame2.d.ts.map +1 -0
- package/dist/devices/wo-art-frame2.js +195 -0
- package/dist/devices/wo-art-frame2.js.map +1 -0
- package/dist/devices/wo-e-ink-photo-magnet.d.ts +8 -0
- package/dist/devices/wo-e-ink-photo-magnet.d.ts.map +1 -0
- package/dist/devices/wo-e-ink-photo-magnet.js +12 -0
- package/dist/devices/wo-e-ink-photo-magnet.js.map +1 -0
- package/dist/devices/wo-lock-pro.d.ts +15 -0
- package/dist/devices/wo-lock-pro.d.ts.map +1 -1
- package/dist/devices/wo-lock-pro.js +34 -0
- package/dist/devices/wo-lock-pro.js.map +1 -1
- package/dist/devices/wo-roller-shade.d.ts +27 -1
- package/dist/devices/wo-roller-shade.d.ts.map +1 -1
- package/dist/devices/wo-roller-shade.js +49 -1
- package/dist/devices/wo-roller-shade.js.map +1 -1
- package/dist/devices/wo-sensor-th-pro-co2.d.ts +50 -2
- package/dist/devices/wo-sensor-th-pro-co2.d.ts.map +1 -1
- package/dist/devices/wo-sensor-th-pro-co2.js +106 -2
- package/dist/devices/wo-sensor-th-pro-co2.js.map +1 -1
- package/dist/devices/wo-sensor-th-pro.d.ts +255 -1
- package/dist/devices/wo-sensor-th-pro.d.ts.map +1 -1
- package/dist/devices/wo-sensor-th-pro.js +556 -1
- package/dist/devices/wo-sensor-th-pro.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/settings.d.ts +7 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +16 -1
- package/dist/settings.js.map +1 -1
- package/dist/switchbot.d.ts.map +1 -1
- package/dist/switchbot.js +4 -0
- package/dist/switchbot.js.map +1 -1
- package/dist/types/device.d.ts +13 -0
- package/dist/types/device.d.ts.map +1 -1
- package/dist/utils/curtain-advertisement.d.ts +21 -0
- package/dist/utils/curtain-advertisement.d.ts.map +1 -0
- package/dist/utils/curtain-advertisement.js +42 -0
- package/dist/utils/curtain-advertisement.js.map +1 -0
- package/dist/utils/image-frame-advertisement.d.ts +25 -0
- package/dist/utils/image-frame-advertisement.d.ts.map +1 -0
- package/dist/utils/image-frame-advertisement.js +31 -0
- package/dist/utils/image-frame-advertisement.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/lock-advertisement.d.ts +11 -2
- package/dist/utils/lock-advertisement.d.ts.map +1 -1
- package/dist/utils/lock-advertisement.js +20 -3
- package/dist/utils/lock-advertisement.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-art-frame2.ts: SwitchBot Art Frame 2 and E Ink Photo Magnet
|
|
4
|
+
*/
|
|
5
|
+
import { Buffer } from 'node:buffer';
|
|
6
|
+
import { randomInt } from 'node:crypto';
|
|
7
|
+
import { SwitchbotOperationError } from '../errors.js';
|
|
8
|
+
import { SequenceDevice } from './sequence-device.js';
|
|
9
|
+
/** Read the device settings (pySwitchbot `DEVICE_GET_BASIC_SETTINGS_KEY`) */
|
|
10
|
+
const COMMAND_GET_BASIC_INFO = [0x57, 0x02];
|
|
11
|
+
/** Show the previous (`00`) or next (`01`) stored image */
|
|
12
|
+
const COMMAND_PREV_IMAGE = [0x57, 0x0F, 0x7A, 0x07, 0x00];
|
|
13
|
+
const COMMAND_NEXT_IMAGE = [0x57, 0x0F, 0x7A, 0x07, 0x01];
|
|
14
|
+
/** Show an image by id, followed by the 16-bit id, little endian */
|
|
15
|
+
const COMMAND_SET_IMAGE_PREFIX = [0x57, 0x0F, 0x7A, 0x02];
|
|
16
|
+
/** Read one packet of the stored image bitmap, followed by the packet number */
|
|
17
|
+
const COMMAND_GET_IMAGE_BITMAP_PREFIX = [0x57, 0x0F, 0x7B, 0x07];
|
|
18
|
+
/** Largest bitmap the frame may send: 2560 bytes, one bit per image id */
|
|
19
|
+
const MAX_IMAGE_BITMAP_BYTES = 2560;
|
|
20
|
+
/**
|
|
21
|
+
* Decode the frame's basic info reply (pySwitchbot `SwitchbotArtFrame2.get_basic_info`).
|
|
22
|
+
* Returns undefined for a missing, failed or short reply.
|
|
23
|
+
*/
|
|
24
|
+
export function parseImageFrameInfo(data) {
|
|
25
|
+
if (!data || data.length < 10 || data[0] !== 1) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
batteryCharging: (data[1] & 0x80) !== 0,
|
|
30
|
+
battery: data[1] & 0x7F,
|
|
31
|
+
firmware: data[2] / 10,
|
|
32
|
+
hardware: data[3],
|
|
33
|
+
displaySize: data[4] >> 4,
|
|
34
|
+
displayMode: (data[4] >> 3) & 1,
|
|
35
|
+
lastNetworkStatus: (data[4] >> 2) & 1,
|
|
36
|
+
currentImageIndex: data.readUInt16LE(5),
|
|
37
|
+
totalNumOfImages: data.readUInt16LE(7),
|
|
38
|
+
orientation: data[9],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** The image ids set in a stored-image bitmap: bit b of byte i is image id i * 8 + b + 1 */
|
|
42
|
+
export function imageIdsFromBitmap(bitmap) {
|
|
43
|
+
const ids = [];
|
|
44
|
+
for (let byteIndex = 0; byteIndex < bitmap.length; byteIndex++) {
|
|
45
|
+
for (let bit = 0; bit < 8; bit++) {
|
|
46
|
+
if (bitmap[byteIndex] & (1 << bit)) {
|
|
47
|
+
ids.push(byteIndex * 8 + bit + 1);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return ids;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Art Frame 2 (pySwitchbot `SwitchbotArtFrame2`, pySwitchbot 3.10.0): an encrypted image frame
|
|
55
|
+
* with 16-bit image ids. Set the account's key with `device.setKey({ keyId, encryptionKey })`.
|
|
56
|
+
*
|
|
57
|
+
* Status comes from the advertisement. The commands are BLE only, except next/previous image,
|
|
58
|
+
* which fall back to the OpenAPI `next` and `previous` commands.
|
|
59
|
+
*/
|
|
60
|
+
export class WoArtFrame2 extends SequenceDevice {
|
|
61
|
+
/** Frame state comes from the manufacturer data in advertisements, as in pySwitchbot */
|
|
62
|
+
get readsFromAdvertisement() {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
/** Send a BLE command and return its reply; throws when BLE fails or the reply is empty */
|
|
66
|
+
async exchange(command, operation) {
|
|
67
|
+
const result = await this.sendBLECommand(command, false, { validateResponse: false });
|
|
68
|
+
if (!result.success) {
|
|
69
|
+
throw new SwitchbotOperationError(`${this.info.name}: ${operation} failed: ${result.error}`);
|
|
70
|
+
}
|
|
71
|
+
const reply = result.data;
|
|
72
|
+
if (!reply || reply.length === 0) {
|
|
73
|
+
throw new SwitchbotOperationError(`${this.info.name}: Sending command failed (result=None operation=${operation})`);
|
|
74
|
+
}
|
|
75
|
+
return reply;
|
|
76
|
+
}
|
|
77
|
+
/** Send a command and report whether the frame answered with status 0x01 */
|
|
78
|
+
async run(command, operation) {
|
|
79
|
+
const reply = await this.exchange(command, operation);
|
|
80
|
+
return reply[0] === 1;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Read the frame settings without downloading the image bitmap (pySwitchbot `get_basic_info`).
|
|
84
|
+
* Returns undefined when the frame refuses the request or the reply is short.
|
|
85
|
+
*/
|
|
86
|
+
async getFrameInfo() {
|
|
87
|
+
const result = await this.sendBLECommand(COMMAND_GET_BASIC_INFO, false, { validateResponse: false });
|
|
88
|
+
if (!result.success) {
|
|
89
|
+
throw new SwitchbotOperationError(`${this.info.name}: getFrameInfo failed: ${result.error}`);
|
|
90
|
+
}
|
|
91
|
+
return parseImageFrameInfo(result.data);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Read the ids of the stored user images, from the frame's packet-ordered bitmap
|
|
95
|
+
* (pySwitchbot `_get_image_indexes`).
|
|
96
|
+
*/
|
|
97
|
+
async getImageIds() {
|
|
98
|
+
const bitmap = [];
|
|
99
|
+
let bitmapLength = 0;
|
|
100
|
+
let totalPackets = 1;
|
|
101
|
+
for (let packet = 0; packet < totalPackets; packet++) {
|
|
102
|
+
const result = await this.sendBLECommand([...COMMAND_GET_IMAGE_BITMAP_PREFIX, packet], false, { validateResponse: false });
|
|
103
|
+
if (!result.success) {
|
|
104
|
+
throw new SwitchbotOperationError(`${this.info.name}: Reading the image bitmap failed: ${result.error}`);
|
|
105
|
+
}
|
|
106
|
+
const data = result.data;
|
|
107
|
+
if (!data
|
|
108
|
+
|| data.length < 4
|
|
109
|
+
|| data[0] !== 1
|
|
110
|
+
|| data[1] === 0
|
|
111
|
+
|| data[2] !== packet
|
|
112
|
+
|| (packet > 0 && data[1] !== totalPackets)
|
|
113
|
+
|| bitmapLength + data.length - 3 > MAX_IMAGE_BITMAP_BYTES) {
|
|
114
|
+
throw new SwitchbotOperationError(`${this.info.name}: Invalid image bitmap response`);
|
|
115
|
+
}
|
|
116
|
+
totalPackets = data[1];
|
|
117
|
+
bitmap.push(data.subarray(3));
|
|
118
|
+
bitmapLength += data.length - 3;
|
|
119
|
+
}
|
|
120
|
+
return imageIdsFromBitmap(Buffer.concat(bitmap));
|
|
121
|
+
}
|
|
122
|
+
async setImageId(imageId) {
|
|
123
|
+
const id = Buffer.alloc(2);
|
|
124
|
+
id.writeUInt16LE(imageId);
|
|
125
|
+
return this.run(Buffer.from([...COMMAND_SET_IMAGE_PREFIX, ...id]), 'setImage');
|
|
126
|
+
}
|
|
127
|
+
/** Show the next stored image (OpenAPI `next` when BLE is unavailable or fails) */
|
|
128
|
+
async nextImage() {
|
|
129
|
+
return this.runWithAPIFallback(COMMAND_NEXT_IMAGE, 'nextImage', 'next');
|
|
130
|
+
}
|
|
131
|
+
/** Show the previous stored image (OpenAPI `previous` when BLE is unavailable or fails) */
|
|
132
|
+
async prevImage() {
|
|
133
|
+
return this.runWithAPIFallback(COMMAND_PREV_IMAGE, 'prevImage', 'previous');
|
|
134
|
+
}
|
|
135
|
+
/** Run a BLE command; fall back to an OpenAPI command when BLE is unavailable or fails */
|
|
136
|
+
async runWithAPIFallback(command, operation, apiCommand) {
|
|
137
|
+
if (this.hasBLE() || !this.hasAPI()) {
|
|
138
|
+
try {
|
|
139
|
+
return await this.run(command, operation);
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
if (!this.enableFallback || !this.hasAPI()) {
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
this.logger.debug(`${operation} over BLE failed, falling back to API`, error);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const result = await this.sendAPICommand(apiCommand);
|
|
149
|
+
return result.success;
|
|
150
|
+
}
|
|
151
|
+
/** Show a random stored user image other than the current one */
|
|
152
|
+
async randomImage() {
|
|
153
|
+
const info = await this.getFrameInfo();
|
|
154
|
+
if (!info) {
|
|
155
|
+
throw new SwitchbotOperationError(`${this.info.name}: Failed to retrieve frame settings`);
|
|
156
|
+
}
|
|
157
|
+
const choices = (await this.getImageIds()).filter(id => id !== info.currentImageIndex);
|
|
158
|
+
if (choices.length === 0) {
|
|
159
|
+
throw new Error('No images available to select from.');
|
|
160
|
+
}
|
|
161
|
+
return this.setImageId(choices[randomInt(choices.length)]);
|
|
162
|
+
}
|
|
163
|
+
/** Show a user image by its zero-based position in the stored list */
|
|
164
|
+
async setImage(index) {
|
|
165
|
+
const ids = await this.getImageIds();
|
|
166
|
+
if (!Number.isInteger(index) || index < 0 || index >= ids.length) {
|
|
167
|
+
throw new RangeError(`Image index ${index} is out of range.`);
|
|
168
|
+
}
|
|
169
|
+
return this.setImageId(ids[index]);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Get device status (BLE advertisement first, API fallback)
|
|
173
|
+
*/
|
|
174
|
+
async getStatus() {
|
|
175
|
+
return this.getStatusWithFallback(bleData => ({
|
|
176
|
+
deviceId: this.info.id,
|
|
177
|
+
connectionType: 'ble',
|
|
178
|
+
battery: bleData.battery,
|
|
179
|
+
batteryCharging: bleData.batteryCharging,
|
|
180
|
+
imageIndex: bleData.imageIndex,
|
|
181
|
+
displaySize: bleData.displaySize,
|
|
182
|
+
displayMode: bleData.displayMode,
|
|
183
|
+
lastNetworkStatus: bleData.lastNetworkStatus,
|
|
184
|
+
orientation: bleData.orientation,
|
|
185
|
+
updatedAt: new Date(),
|
|
186
|
+
}), apiStatus => ({
|
|
187
|
+
deviceId: this.info.id,
|
|
188
|
+
connectionType: 'api',
|
|
189
|
+
battery: apiStatus.battery,
|
|
190
|
+
version: apiStatus.version,
|
|
191
|
+
updatedAt: new Date(),
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=wo-art-frame2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-art-frame2.js","sourceRoot":"","sources":["../../src/devices/wo-art-frame2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,6EAA6E;AAC7E,MAAM,sBAAsB,G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ACtB,cAAc,EAAE,KAAK;YACrB,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC,CACH,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WoArtFrame2 } from './wo-art-frame2.js';
|
|
2
|
+
/**
|
|
3
|
+
* E Ink Photo Magnet (pySwitchbot `SwitchbotEInkPhotoMagnet`, pySwitchbot 3.9.0): the Art Frame 2
|
|
4
|
+
* protocol and advertisement.
|
|
5
|
+
*/
|
|
6
|
+
export declare class WoEInkPhotoMagnet extends WoArtFrame2 {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=wo-e-ink-photo-magnet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-e-ink-photo-magnet.d.ts","sourceRoot":"","sources":["../../src/devices/wo-e-ink-photo-magnet.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-e-ink-photo-magnet.ts: SwitchBot E Ink Photo Magnet
|
|
4
|
+
*/
|
|
5
|
+
import { WoArtFrame2 } from './wo-art-frame2.js';
|
|
6
|
+
/**
|
|
7
|
+
* E Ink Photo Magnet (pySwitchbot `SwitchbotEInkPhotoMagnet`, pySwitchbot 3.9.0): the Art Frame 2
|
|
8
|
+
* protocol and advertisement.
|
|
9
|
+
*/
|
|
10
|
+
export class WoEInkPhotoMagnet extends WoArtFrame2 {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-e-ink-photo-magnet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-e-ink-photo-magnet.js","sourceRoot":"","sources":["../../src/devices/wo-e-ink-photo-magnet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;CAAG"}
|
|
@@ -2,6 +2,16 @@ import type { Buffer } from 'node:buffer';
|
|
|
2
2
|
import type { LockCommandSet, LockModel } from '../settings.js';
|
|
3
3
|
import type { LockCommands, LockStatus } from '../types/device.js';
|
|
4
4
|
import { SequenceDevice } from './sequence-device.js';
|
|
5
|
+
/** Charge of the Lock Pro's two battery bays; undefined for an empty bay */
|
|
6
|
+
export interface LockBatteryBays {
|
|
7
|
+
leftBattery?: number;
|
|
8
|
+
rightBattery?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Decode the Lock Pro battery bays reply (pySwitchbot `_parse_battery_bays`): bytes 1 and 2 are
|
|
12
|
+
* the left and right bay, bit 7 set when a battery is present and bits 0-6 its level.
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseLockBatteryBays(reply: Buffer): LockBatteryBays;
|
|
5
15
|
/**
|
|
6
16
|
* Smart Lock Pro Device (with unlatch support)
|
|
7
17
|
*/
|
|
@@ -31,6 +41,11 @@ export declare class WoSmartLockPro extends SequenceDevice implements LockComman
|
|
|
31
41
|
* sends the unlock command (pySwitchbot has no separate unlatch command).
|
|
32
42
|
*/
|
|
33
43
|
unlatch(): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Read the level of each battery bay (Lock Pro only, BLE only; pySwitchbot 3.11.0). Returns
|
|
46
|
+
* undefined when the lock refuses the request or the reply is too short.
|
|
47
|
+
*/
|
|
48
|
+
getBatteryBays(): Promise<LockBatteryBays | undefined>;
|
|
34
49
|
getLockInfo(): Promise<Record<string, unknown>>;
|
|
35
50
|
onLockNotification(handler: (payload: Buffer) => void): Promise<void>;
|
|
36
51
|
offLockNotification(handler: (payload: Buffer) => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-lock-pro.d.ts","sourceRoot":"","sources":["../../src/devices/wo-lock-pro.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGlE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD;;GAEG;AACH,qBAAa,cAAe,SAAQ,cAAe,YAAW,YAAY;IACxE,OAAO,CAAC,wBAAwB,CAAuC;IAEvE,iEAAiE;IACjE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAa;IAE3D,yFAAyF;IACzF,IAAI,SAAS,IAAI,SAAS,CAEzB;IAED,SAAS,KAAK,YAAY,IAAI,cAAc,CAE3C;IAED,uFAAuF;IACvF,cAAuB,sBAAsB,IAAI,OAAO,CAEvD;IAED;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAiB9B;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAiBhC;;OAEG;IACG,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC;IAS9C;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"wo-lock-pro.d.ts","sourceRoot":"","sources":["../../src/devices/wo-lock-pro.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,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*/
|
|
5
5
|
import { lockCommandsFor, resolveLockModel } from './lock-model.js';
|
|
6
6
|
import { SequenceDevice } from './sequence-device.js';
|
|
7
|
+
/** Command status bytes that mean success: 0x01, or 0x06 for success with a low battery */
|
|
8
|
+
const LOCK_COMMAND_OK = new Set([0x01, 0x06]);
|
|
9
|
+
/**
|
|
10
|
+
* Decode the Lock Pro battery bays reply (pySwitchbot `_parse_battery_bays`): bytes 1 and 2 are
|
|
11
|
+
* the left and right bay, bit 7 set when a battery is present and bits 0-6 its level.
|
|
12
|
+
*/
|
|
13
|
+
export function parseLockBatteryBays(reply) {
|
|
14
|
+
const bay = (value) => (value & 0x80) !== 0 ? value & 0x7F : undefined;
|
|
15
|
+
return { leftBattery: bay(reply[1]), rightBattery: bay(reply[2]) };
|
|
16
|
+
}
|
|
7
17
|
/**
|
|
8
18
|
* Smart Lock Pro Device (with unlatch support)
|
|
9
19
|
*/
|
|
@@ -69,6 +79,30 @@ export class WoSmartLockPro extends SequenceDevice {
|
|
|
69
79
|
const result = await this.sendCommand(this.lockCommands.unlock, 'unlock');
|
|
70
80
|
return result.success;
|
|
71
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Read the level of each battery bay (Lock Pro only, BLE only; pySwitchbot 3.11.0). Returns
|
|
84
|
+
* undefined when the lock refuses the request or the reply is too short.
|
|
85
|
+
*/
|
|
86
|
+
async getBatteryBays() {
|
|
87
|
+
const command = this.lockCommands.batteryBays;
|
|
88
|
+
if (!command) {
|
|
89
|
+
throw new Error(`Battery bays are not supported on the ${this.lockModel}`);
|
|
90
|
+
}
|
|
91
|
+
const result = await this.sendBLECommand(command, false, { validateResponse: false });
|
|
92
|
+
if (!result.success) {
|
|
93
|
+
throw new Error(`Failed to read battery bays: ${result.error}`);
|
|
94
|
+
}
|
|
95
|
+
const reply = result.data;
|
|
96
|
+
if (!reply || !LOCK_COMMAND_OK.has(reply[0])) {
|
|
97
|
+
this.logger.warn('Unable to read battery bays', reply?.toString('hex'));
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
if (reply.length < 3) {
|
|
101
|
+
this.logger.warn('Invalid battery bays data received', reply.toString('hex'));
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
return parseLockBatteryBays(reply);
|
|
105
|
+
}
|
|
72
106
|
async getLockInfo() {
|
|
73
107
|
if (this.hasAPI()) {
|
|
74
108
|
const status = await this.getAPIStatus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-lock-pro.js","sourceRoot":"","sources":["../../src/devices/wo-lock-pro.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"wo-lock-pro.js","sourceRoot":"","sources":["../../src/devices/wo-lock-pro.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAQrD,2FAA2F;AAC3F,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAE7C;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;IAC9E,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,cAAe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
/**
|
|
3
3
|
* Roller Shade Device
|
|
4
|
-
*
|
|
4
|
+
*
|
|
5
|
+
* Status is read like a Curtain, but commands use the Roller Shade command set (`57 0F 47 01`),
|
|
6
|
+
* as in pySwitchbot's `SwitchbotRollerShade`. The Roller Shade rejects the Curtain command
|
|
7
|
+
* (`57 0F 45 01`) with `0x0D`. Positions are as the shade reports them: 0 open, 100 closed.
|
|
5
8
|
*/
|
|
6
9
|
export declare class WoRollerShade extends WoCurtain {
|
|
10
|
+
/**
|
|
11
|
+
* Open the shade (position 0). `mode`: 0 performance, 1 quiet.
|
|
12
|
+
*/
|
|
13
|
+
open(mode?: number): Promise<boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* Close the shade (position 100). `mode`: 0 performance, 1 quiet.
|
|
16
|
+
*/
|
|
17
|
+
close(mode?: number): Promise<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* Stop the shade.
|
|
20
|
+
*/
|
|
21
|
+
pause(): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Move to a position (0 open, 100 closed). `mode`: 0 performance, 1 quiet.
|
|
24
|
+
*/
|
|
25
|
+
setPosition(position: number, mode?: number): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* pySwitchbot sends the plain position command and the position-with-mode command and
|
|
28
|
+
* succeeds if either is accepted. Here the plain command goes first (with OpenAPI fallback,
|
|
29
|
+
* whose `setPosition` takes the bare position); the mode command is tried over BLE only if it
|
|
30
|
+
* fails.
|
|
31
|
+
*/
|
|
32
|
+
private moveTo;
|
|
7
33
|
}
|
|
8
34
|
//# sourceMappingURL=wo-roller-shade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-roller-shade.d.ts","sourceRoot":"","sources":["../../src/devices/wo-roller-shade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wo-roller-shade.d.ts","sourceRoot":"","sources":["../../src/devices/wo-roller-shade.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C;;OAEG;IACY,IAAI,CAAC,IAAI,SAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/C;;OAEG;IACY,KAAK,CAAC,IAAI,SAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhD;;OAEG;IACY,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAKxC;;OAEG;IACY,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxE;;;;;OAKG;YACW,MAAM;CAgBrB"}
|
|
@@ -2,11 +2,59 @@
|
|
|
2
2
|
*
|
|
3
3
|
* devices/wo-roller-shade.ts: SwitchBot v4.0.0 - Roller Shade
|
|
4
4
|
*/
|
|
5
|
+
import { DEVICE_COMMANDS } from '../settings.js';
|
|
6
|
+
import { clamp } from '../utils/index.js';
|
|
5
7
|
import { WoCurtain } from './wo-curtain.js';
|
|
6
8
|
/**
|
|
7
9
|
* Roller Shade Device
|
|
8
|
-
*
|
|
10
|
+
*
|
|
11
|
+
* Status is read like a Curtain, but commands use the Roller Shade command set (`57 0F 47 01`),
|
|
12
|
+
* as in pySwitchbot's `SwitchbotRollerShade`. The Roller Shade rejects the Curtain command
|
|
13
|
+
* (`57 0F 45 01`) with `0x0D`. Positions are as the shade reports them: 0 open, 100 closed.
|
|
9
14
|
*/
|
|
10
15
|
export class WoRollerShade extends WoCurtain {
|
|
16
|
+
/**
|
|
17
|
+
* Open the shade (position 0). `mode`: 0 performance, 1 quiet.
|
|
18
|
+
*/
|
|
19
|
+
async open(mode = 0) {
|
|
20
|
+
return this.moveTo(0, mode);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Close the shade (position 100). `mode`: 0 performance, 1 quiet.
|
|
24
|
+
*/
|
|
25
|
+
async close(mode = 0) {
|
|
26
|
+
return this.moveTo(100, mode);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Stop the shade.
|
|
30
|
+
*/
|
|
31
|
+
async pause() {
|
|
32
|
+
const result = await this.sendCommand(DEVICE_COMMANDS.ROLLER_SHADE.PAUSE, 'pause');
|
|
33
|
+
return result.success;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Move to a position (0 open, 100 closed). `mode`: 0 performance, 1 quiet.
|
|
37
|
+
*/
|
|
38
|
+
async setPosition(position, mode = 0) {
|
|
39
|
+
return this.moveTo(position, mode);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* pySwitchbot sends the plain position command and the position-with-mode command and
|
|
43
|
+
* succeeds if either is accepted. Here the plain command goes first (with OpenAPI fallback,
|
|
44
|
+
* whose `setPosition` takes the bare position); the mode command is tried over BLE only if it
|
|
45
|
+
* fails.
|
|
46
|
+
*/
|
|
47
|
+
async moveTo(position, mode) {
|
|
48
|
+
if (mode !== 0 && mode !== 1) {
|
|
49
|
+
throw new RangeError(`mode must be 0 (performance) or 1 (quiet), got ${mode}`);
|
|
50
|
+
}
|
|
51
|
+
const target = Math.round(clamp(position, 0, 100));
|
|
52
|
+
const result = await this.sendCommand([...DEVICE_COMMANDS.ROLLER_SHADE.POSITION, target], 'setPosition', target);
|
|
53
|
+
if (result.success || !this.hasBLE()) {
|
|
54
|
+
return result.success;
|
|
55
|
+
}
|
|
56
|
+
const withMode = await this.sendBLECommand([...DEVICE_COMMANDS.ROLLER_SHADE.POSITION_WITH_MODE, mode, target]);
|
|
57
|
+
return withMode.success;
|
|
58
|
+
}
|
|
11
59
|
}
|
|
12
60
|
//# sourceMappingURL=wo-roller-shade.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-roller-shade.js","sourceRoot":"","sources":["../../src/devices/wo-roller-shade.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C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,CAAC,CAAC,CAAA;QAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CACnC,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,EAClD,aAAa,EACb,MAAM,CACP,CAAA;QACD,IAAI,MAAM,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YACrC,OAAO,MAAM,CAAC,OAAO,CAAA;QACvB,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,kBAAkB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;QAC9G,OAAO,QAAQ,CAAC,OAAO,CAAA;IACzB,CAAC;CACF"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import type { MeterProCO2Status } from '../types/device.js';
|
|
2
|
-
import {
|
|
2
|
+
import { WoSensorTHPro } from './wo-sensor-th-pro.js';
|
|
3
|
+
/** CO2 alarm settings (getCo2Alarm) */
|
|
4
|
+
export interface MeterProCO2Alarm {
|
|
5
|
+
/** MeterProCO2AlarmMode flags */
|
|
6
|
+
mode: number;
|
|
7
|
+
lowPpm: number;
|
|
8
|
+
highPpm: number;
|
|
9
|
+
/** MeterProCO2AlarmStatus */
|
|
10
|
+
status: number;
|
|
11
|
+
}
|
|
12
|
+
/** CO2 colour level thresholds (getCo2LevelThresholds) */
|
|
13
|
+
export interface MeterProCO2LevelThresholds {
|
|
14
|
+
greenToYellowPpm: number;
|
|
15
|
+
yellowToRedPpm: number;
|
|
16
|
+
}
|
|
3
17
|
/**
|
|
4
18
|
* Meter Pro CO2 (Temperature/Humidity/CO2 Sensor)
|
|
5
19
|
*
|
|
@@ -11,8 +25,42 @@ import { WoSensorTH } from './wo-sensor-th.js';
|
|
|
11
25
|
* omitted on the BLE path rather than reported as 0 - a real reading of 0 ppm
|
|
12
26
|
* is not physically meaningful, and a placeholder would be indistinguishable
|
|
13
27
|
* from a working sensor.
|
|
28
|
+
*
|
|
29
|
+
* It has every Meter Pro setting, plus the CO2 controls of pySwitchbot's
|
|
30
|
+
* SwitchbotMeterProCO2 (3.13.0, 3.15.0), which are BLE only.
|
|
14
31
|
*/
|
|
15
|
-
export declare class WoSensorTHProCO2 extends
|
|
32
|
+
export declare class WoSensorTHProCO2 extends WoSensorTHPro {
|
|
33
|
+
/** Request a CO2 sample; sent once (pySwitchbot 3.13.0) */
|
|
34
|
+
triggerCo2Sampling(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Start manual CO2 calibration; sent once (pySwitchbot 3.13.0). Place the meter outdoors in a
|
|
37
|
+
* well-ventilated area for one minute first, and keep it still during the five-minute
|
|
38
|
+
* calibration.
|
|
39
|
+
*/
|
|
40
|
+
startCo2Calibration(): Promise<void>;
|
|
41
|
+
/** Whether USB-C power is connected (pySwitchbot 3.13.0) */
|
|
42
|
+
isUsbPowered(): Promise<boolean>;
|
|
43
|
+
/** The CO2 update interval on battery power, in seconds (pySwitchbot 3.13.0) */
|
|
44
|
+
getCo2BatteryUpdateInterval(): Promise<number>;
|
|
45
|
+
/** Set the CO2 update interval on battery power, 1-65535 seconds (pySwitchbot 3.13.0) */
|
|
46
|
+
setCo2BatteryUpdateInterval(seconds: number): Promise<void>;
|
|
47
|
+
/** The CO2 update interval on USB power, in seconds (pySwitchbot 3.13.0) */
|
|
48
|
+
getCo2UsbUpdateInterval(): Promise<number>;
|
|
49
|
+
/** Set the CO2 update interval on USB power, 1-65535 seconds (pySwitchbot 3.13.0) */
|
|
50
|
+
setCo2UsbUpdateInterval(seconds: number): Promise<void>;
|
|
51
|
+
private getCo2UpdateInterval;
|
|
52
|
+
private setCo2UpdateInterval;
|
|
53
|
+
/** Read the CO2 alarm conditions, limits in ppm and current alarm status (pySwitchbot 3.15.0) */
|
|
54
|
+
getCo2Alarm(): Promise<MeterProCO2Alarm>;
|
|
55
|
+
/**
|
|
56
|
+
* Set the CO2 alarm conditions (MeterProCO2AlarmMode flags) and limits in ppm (pySwitchbot
|
|
57
|
+
* 3.15.0). Pass the existing limits when disabling an alarm to keep them configured.
|
|
58
|
+
*/
|
|
59
|
+
setCo2Alarm(mode: number, lowPpm: number, highPpm: number): Promise<void>;
|
|
60
|
+
/** Read the green-to-yellow and yellow-to-red CO2 thresholds in ppm (pySwitchbot 3.13.0) */
|
|
61
|
+
getCo2LevelThresholds(): Promise<MeterProCO2LevelThresholds>;
|
|
62
|
+
/** Set the green-to-yellow and yellow-to-red CO2 thresholds, in 100 ppm steps (pySwitchbot 3.13.0) */
|
|
63
|
+
setCo2LevelThresholds(greenToYellowPpm: number, yellowToRedPpm: number): Promise<void>;
|
|
16
64
|
/**
|
|
17
65
|
* Get device status (BLE-first, API-fallback)
|
|
18
66
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-sensor-th-pro-co2.d.ts","sourceRoot":"","sources":["../../src/devices/wo-sensor-th-pro-co2.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"wo-sensor-th-pro-co2.d.ts","sourceRoot":"","sources":["../../src/devices/wo-sensor-th-pro-co2.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,OAAO,EAAa,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAEhE,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,0DAA0D;AAC1D,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;CACv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