homebridge-bedjet 0.1.3 → 0.1.5
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/package.json +1 -1
- package/src/bedjet/BedJet.ts +9 -1
package/package.json
CHANGED
package/src/bedjet/BedJet.ts
CHANGED
|
@@ -179,11 +179,19 @@ export class BedJet extends EventEmitter {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
// Subscribe to notifications on the status characteristic
|
|
182
|
-
|
|
182
|
+
this.log.info(`[${this.config.name}] Subscribing to notifications…`);
|
|
183
|
+
await Promise.race([
|
|
184
|
+
this.statusChar.subscribeAsync(),
|
|
185
|
+
new Promise<never>((_, reject) =>
|
|
186
|
+
setTimeout(() => reject(new Error(`[${this.config.name}] Subscribe timed out`)), 10_000),
|
|
187
|
+
),
|
|
188
|
+
]);
|
|
189
|
+
this.log.info(`[${this.config.name}] Subscribed — reading device status…`);
|
|
183
190
|
this.statusChar.on('data', (data: Buffer) => this._handleNotification(data));
|
|
184
191
|
|
|
185
192
|
// Read extended status and device name
|
|
186
193
|
await this._readDeviceStatus();
|
|
194
|
+
this.log.info(`[${this.config.name}] Reading device name…`);
|
|
187
195
|
await this._readDeviceName();
|
|
188
196
|
|
|
189
197
|
this.reconnectAttempts = 0;
|