homebridge-lovesac-stealthtech 1.1.2 → 1.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/dist/ble/BleClient.js +12 -1
- package/dist/settings.d.ts +1 -1
- package/dist/settings.js +1 -1
- package/package.json +1 -1
package/dist/ble/BleClient.js
CHANGED
|
@@ -60,7 +60,18 @@ class BleClient {
|
|
|
60
60
|
await (0, settings_1.withTimeout)(peripheral.connectAsync(), settings_1.BLE_CONNECT_TIMEOUT, 'BLE connect');
|
|
61
61
|
}
|
|
62
62
|
catch (err) {
|
|
63
|
-
|
|
63
|
+
// Cancel the pending HCI connection and reset the adapter so
|
|
64
|
+
// subsequent scans still work (BlueZ gets stuck otherwise).
|
|
65
|
+
if (peripheral.state === 'connecting') {
|
|
66
|
+
try {
|
|
67
|
+
peripheral.cancelConnect();
|
|
68
|
+
}
|
|
69
|
+
catch { /* best effort */ }
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
peripheral.disconnectAsync().catch(() => { });
|
|
73
|
+
}
|
|
74
|
+
noble_1.default.reset();
|
|
64
75
|
throw err;
|
|
65
76
|
}
|
|
66
77
|
this._connected = true;
|
package/dist/settings.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const CharUUID: {
|
|
|
17
17
|
};
|
|
18
18
|
export declare const MAX_VOLUME = 36;
|
|
19
19
|
export declare const BLE_SCAN_TIMEOUT = 15000;
|
|
20
|
-
export declare const BLE_CONNECT_TIMEOUT =
|
|
20
|
+
export declare const BLE_CONNECT_TIMEOUT = 10000;
|
|
21
21
|
export declare const BLE_WRITE_TIMEOUT = 10000;
|
|
22
22
|
export declare const BLE_DISCONNECT_TIMEOUT = 10000;
|
|
23
23
|
export declare const BLE_DISCOVER_TIMEOUT = 15000;
|
package/dist/settings.js
CHANGED
|
@@ -25,7 +25,7 @@ exports.CharUUID = {
|
|
|
25
25
|
exports.MAX_VOLUME = 36;
|
|
26
26
|
exports.BLE_SCAN_TIMEOUT = 15000;
|
|
27
27
|
// BLE operation timeouts (milliseconds)
|
|
28
|
-
exports.BLE_CONNECT_TIMEOUT =
|
|
28
|
+
exports.BLE_CONNECT_TIMEOUT = 10_000;
|
|
29
29
|
exports.BLE_WRITE_TIMEOUT = 10_000;
|
|
30
30
|
exports.BLE_DISCONNECT_TIMEOUT = 10_000;
|
|
31
31
|
exports.BLE_DISCOVER_TIMEOUT = 15_000;
|