incyclist-devices 1.4.68 → 1.4.69

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.
@@ -108,8 +108,6 @@ class BleDevice extends ble_1.BleDeviceClass {
108
108
  }
109
109
  init() {
110
110
  return __awaiter(this, void 0, void 0, function* () {
111
- if (this.isInitialized)
112
- return Promise.resolve(true);
113
111
  return yield this.initDevice();
114
112
  });
115
113
  }
@@ -269,7 +267,7 @@ class BleDevice extends ble_1.BleDeviceClass {
269
267
  const updatedQueue = [];
270
268
  let hasTimeout = false;
271
269
  this.writeQueue.forEach(writeItem => {
272
- if (writeItem.timeout && writeItem.timeout > now) {
270
+ if (writeItem.timeout && writeItem.timeout < now) {
273
271
  if (writeItem.reject) {
274
272
  hasTimeout = true;
275
273
  writeItem.reject(new Error('timeout'));
@@ -326,7 +324,7 @@ class BleDevice extends ble_1.BleDeviceClass {
326
324
  else {
327
325
  const writeId = this.writeQueue.length;
328
326
  let messageDeleted = false;
329
- this.writeQueue.push({ uuid: characteristicUuid.toLocaleLowerCase(), data, timeout: Date.now() + 1000, resolve, reject });
327
+ this.writeQueue.push({ uuid: characteristicUuid.toLocaleLowerCase(), data, timeout: Date.now() + 2500, resolve, reject });
330
328
  const to = setTimeout(() => {
331
329
  if (this.writeQueue.length > writeId && !messageDeleted)
332
330
  this.writeQueue.splice(writeId, 1);
package/lib/ble/fm.js CHANGED
@@ -424,9 +424,11 @@ class BleFitnessMachineDevice extends ble_device_1.BleDevice {
424
424
  }
425
425
  setIndoorBikeSimulation(windSpeed, gradient, crr, cw) {
426
426
  return __awaiter(this, void 0, void 0, function* () {
427
- if (!this.hasControl)
428
- return;
429
427
  const hasControl = yield this.requestControl();
428
+ if (!hasControl) {
429
+ this.logEvent({ message: 'setTargetInclination failed', reason: 'control is disabled' });
430
+ return;
431
+ }
430
432
  const data = Buffer.alloc(7);
431
433
  data.writeUInt8(17, 0);
432
434
  data.writeInt16LE(Math.round(windSpeed * 1000), 1);
@@ -1,7 +1,7 @@
1
1
  export declare const DEFAULT_AGE = 30;
2
2
  export declare const DEFAULT_USER_WEIGHT = 75;
3
3
  export declare const DEFAULT_BIKE_WEIGHT = 10;
4
- export declare function getCockpit(c: any): "Cardio" | "Fitness" | "Vita De Luxe" | "8008" | "8008 TRS" | "8080" | "Therapie" | "8008 TRS Pro" | "8008 TRS3" | "Unknown";
4
+ export declare function getCockpit(c: any): "Cardio" | "Fitness" | "Vita De Luxe" | "8008" | "8008 TRS" | "8080" | "Therapie" | "8008 TRS Pro" | "8008 TRS3" | "ergo_lyps Cardio Pro" | "Unknown";
5
5
  export declare function getBikeType(type: any): 1 | 0;
6
6
  export declare function getGender(sex: any): 1 | 2;
7
7
  export declare function getLength(length: any): number;
@@ -24,6 +24,8 @@ function getCockpit(c) {
24
24
  return "8008 TRS Pro";
25
25
  case 160:
26
26
  return "8008 TRS3";
27
+ case 0x8D:
28
+ return "ergo_lyps Cardio Pro";
27
29
  default:
28
30
  return "Unknown";
29
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "1.4.68",
3
+ "version": "1.4.69",
4
4
  "dependencies": {
5
5
  "@serialport/parser-byte-length": "^9.0.1",
6
6
  "@serialport/parser-delimiter": "^9.0.1",