incyclist-devices 2.0.14 → 2.0.16

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/lib/adapters.js CHANGED
@@ -45,5 +45,5 @@ class AdapterFactory {
45
45
  return adapter;
46
46
  }
47
47
  }
48
- exports.default = AdapterFactory;
49
48
  AdapterFactory.adapters = [];
49
+ exports.default = AdapterFactory;
@@ -28,10 +28,10 @@ export default class AntAdapter<TDeviceData extends BaseDeviceData, TData> exten
28
28
  };
29
29
  onDataFn: (data: TData) => void;
30
30
  startupRetryPause: number;
31
- protected ivDataTimeout: NodeJS.Timer;
31
+ protected ivDataTimeout: NodeJS.Timeout;
32
32
  protected lastDataTS: number;
33
33
  protected dataMsgCount: number;
34
- protected ivWaitForData: NodeJS.Timer;
34
+ protected ivWaitForData: NodeJS.Timeout;
35
35
  constructor(settings: AntDeviceSettings, props?: DeviceProperties);
36
36
  createSensor(settings: AntDeviceSettings): ISensor;
37
37
  isEqual(settings: AntDeviceSettings): boolean;
@@ -280,6 +280,6 @@ class AntInterface extends events_1.default {
280
280
  return (this.activeScan === undefined || this.activeScan === null);
281
281
  }
282
282
  }
283
- exports.default = AntInterface;
284
283
  AntInterface._instance = undefined;
285
284
  AntInterface.INTERFACE_NAME = 'ant';
285
+ exports.default = AntInterface;
@@ -352,6 +352,6 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
352
352
  });
353
353
  }
354
354
  }
355
- exports.default = AntFEAdapter;
356
355
  AntFEAdapter.INCYCLIST_PROFILE_NAME = 'Smart Trainer';
357
356
  AntFEAdapter.ANT_PROFILE_NAME = 'FE';
357
+ exports.default = AntFEAdapter;
@@ -71,6 +71,6 @@ class AntHrAdapter extends adapter_1.default {
71
71
  return this.deviceData.ComputedHeartRate !== undefined && this.deviceData.ComputedHeartRate !== null;
72
72
  }
73
73
  }
74
- exports.default = AntHrAdapter;
75
74
  AntHrAdapter.INCYCLIST_PROFILE_NAME = 'Heartrate Monitor';
76
75
  AntHrAdapter.ANT_PROFILE_NAME = 'HR';
76
+ exports.default = AntHrAdapter;
@@ -10,5 +10,5 @@ class AntFeERGCyclingMode extends ble_erg_mode_1.default {
10
10
  this.initLogger('AntERGMode');
11
11
  }
12
12
  }
13
- exports.default = AntFeERGCyclingMode;
14
13
  AntFeERGCyclingMode.isERG = true;
14
+ exports.default = AntFeERGCyclingMode;
@@ -136,6 +136,6 @@ class AntPwrAdapter extends adapter_1.ControllableAntAdapter {
136
136
  TimeStamp !== undefined || TimeStamp !== null;
137
137
  }
138
138
  }
139
- exports.default = AntPwrAdapter;
140
139
  AntPwrAdapter.INCYCLIST_PROFILE_NAME = 'Power Meter';
141
140
  AntPwrAdapter.ANT_PROFILE_NAME = 'PWR';
141
+ exports.default = AntPwrAdapter;
@@ -42,7 +42,7 @@ export declare class StaticWriteCharacteristic extends MockCharacteristic {
42
42
  }
43
43
  export declare abstract class StaticNotifyCharacteristic extends MockCharacteristic {
44
44
  cntSubscriptions: number;
45
- iv: NodeJS.Timer;
45
+ iv: NodeJS.Timeout;
46
46
  notifyFrequency: number;
47
47
  constructor(uuid: string, description: string);
48
48
  subscribe(callback: (err: Error | undefined) => void): void;
@@ -118,8 +118,8 @@ class BleCyclingPowerDevice extends comms_1.BleComms {
118
118
  this.prevCrankData = undefined;
119
119
  }
120
120
  }
121
- exports.default = BleCyclingPowerDevice;
122
121
  BleCyclingPowerDevice.protocol = 'cp';
123
122
  BleCyclingPowerDevice.services = [consts_1.CSP];
124
123
  BleCyclingPowerDevice.characteristics = [consts_1.CSP_MEASUREMENT, consts_1.CSP_FEATURE, '2a5d', '2a3c'];
125
124
  BleCyclingPowerDevice.detectionPriority = 1;
125
+ exports.default = BleCyclingPowerDevice;
@@ -119,8 +119,8 @@ class BleEliteDevice extends comms_1.BleComms {
119
119
  this.prevCrankData = undefined;
120
120
  }
121
121
  }
122
- exports.default = BleEliteDevice;
123
122
  BleEliteDevice.protocol = 'elite';
124
123
  BleEliteDevice.services = [consts_1.ELITE_TRAINER_SVC];
125
124
  BleEliteDevice.characteristics = [consts_1.CSP_MEASUREMENT, consts_1.CSP_FEATURE, '2a5d', '2a3c'];
126
125
  BleEliteDevice.detectionPriority = 10;
126
+ exports.default = BleEliteDevice;
@@ -496,8 +496,8 @@ class BleFitnessMachineDevice extends comms_1.BleComms {
496
496
  this.data = {};
497
497
  }
498
498
  }
499
- exports.default = BleFitnessMachineDevice;
500
499
  BleFitnessMachineDevice.protocol = 'fm';
501
500
  BleFitnessMachineDevice.services = [consts_1.FTMS];
502
501
  BleFitnessMachineDevice.characteristics = ['2acc', consts_1.INDOOR_BIKE_DATA, '2ad6', '2ad8', consts_1.FTMS_CP, consts_1.FTMS_STATUS];
503
502
  BleFitnessMachineDevice.detectionPriority = 100;
503
+ exports.default = BleFitnessMachineDevice;
@@ -49,8 +49,8 @@ class BleHrmDevice extends comms_1.BleComms {
49
49
  return true;
50
50
  }
51
51
  }
52
- exports.default = BleHrmDevice;
53
52
  BleHrmDevice.protocol = 'hr';
54
53
  BleHrmDevice.services = ['180d'];
55
54
  BleHrmDevice.characteristics = ['2a37', '2a38', '2a39', '2a3c'];
56
55
  BleHrmDevice.detectionPriority = 1;
56
+ exports.default = BleHrmDevice;
@@ -625,9 +625,9 @@ class TacxAdvancedFitnessMachineDevice extends comms_1.default {
625
625
  this.data = {};
626
626
  }
627
627
  }
628
- exports.default = TacxAdvancedFitnessMachineDevice;
629
628
  TacxAdvancedFitnessMachineDevice.protocol = 'tacx';
630
629
  TacxAdvancedFitnessMachineDevice.services = [consts_1.TACX_FE_C_BLE];
631
630
  TacxAdvancedFitnessMachineDevice.characteristics = ['2acc', '2ad2', '2ad6', '2ad8', '2ad9', '2ada', consts_1.TACX_FE_C_RX, consts_1.TACX_FE_C_TX];
632
631
  TacxAdvancedFitnessMachineDevice.PROFILE = PROFILE_ID;
633
632
  TacxAdvancedFitnessMachineDevice.detectionPriority = 10;
633
+ exports.default = TacxAdvancedFitnessMachineDevice;
@@ -391,8 +391,8 @@ class BleWahooDevice extends comms_1.default {
391
391
  this.simModeSettings = undefined;
392
392
  }
393
393
  }
394
- exports.default = BleWahooDevice;
395
394
  BleWahooDevice.protocol = 'wahoo';
396
395
  BleWahooDevice.services = [consts_1.CSP];
397
396
  BleWahooDevice.characteristics = ['2acc', '2ad2', '2ad6', '2ad8', '2ad9', '2ada', consts_1.WAHOO_ADVANCED_TRAINER_CP];
398
397
  BleWahooDevice.detectionPriority = 5;
398
+ exports.default = BleWahooDevice;
@@ -144,5 +144,5 @@ class BleERGCyclingMode extends power_base_1.default {
144
144
  return data;
145
145
  }
146
146
  }
147
- exports.default = BleERGCyclingMode;
148
147
  BleERGCyclingMode.isERG = true;
148
+ exports.default = BleERGCyclingMode;
@@ -9,7 +9,7 @@ var CyclingModeProperyType;
9
9
  CyclingModeProperyType["String"] = "String";
10
10
  CyclingModeProperyType["SingleSelect"] = "SingleSelect";
11
11
  CyclingModeProperyType["MultiSelect"] = "MultiSelect";
12
- })(CyclingModeProperyType = exports.CyclingModeProperyType || (exports.CyclingModeProperyType = {}));
12
+ })(CyclingModeProperyType || (exports.CyclingModeProperyType = CyclingModeProperyType = {}));
13
13
  class CyclingModeBase {
14
14
  constructor(adapter, props) {
15
15
  this.settings = {};
@@ -136,5 +136,5 @@ class SimulatorCyclingMode extends power_base_1.default {
136
136
  return data;
137
137
  }
138
138
  }
139
- exports.default = SimulatorCyclingMode;
140
139
  SimulatorCyclingMode.isERG = true;
140
+ exports.default = SimulatorCyclingMode;
@@ -206,5 +206,5 @@ class ERGCyclingMode extends power_base_1.default {
206
206
  return target;
207
207
  }
208
208
  }
209
- exports.default = ERGCyclingMode;
210
209
  ERGCyclingMode.isERG = true;
210
+ exports.default = ERGCyclingMode;
@@ -24,7 +24,7 @@ var direction;
24
24
  (function (direction) {
25
25
  direction["up"] = "up";
26
26
  direction["down"] = "down";
27
- })(direction = exports.direction || (exports.direction = {}));
27
+ })(direction || (exports.direction = direction = {}));
28
28
  class SmartTrainerCyclingMode extends cycling_mode_1.CyclingModeBase {
29
29
  constructor(adapter, props) {
30
30
  super(adapter, props);
@@ -246,5 +246,5 @@ class DaumClassicAdapter extends DaumAdapter_1.default {
246
246
  return this.getBike().runData();
247
247
  }
248
248
  }
249
- exports.default = DaumClassicAdapter;
250
249
  DaumClassicAdapter.NAME = PROTOCOL_NAME;
250
+ exports.default = DaumClassicAdapter;
@@ -177,6 +177,7 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
177
177
  }
178
178
  launch(props = {}, isRelaunch = false) {
179
179
  return __awaiter(this, void 0, void 0, function* () {
180
+ const isPaused = this.isPaused() !== false;
180
181
  this.setBikeProps(props);
181
182
  const user = this.user;
182
183
  const { route, onStatusUpdate, gear } = props;
@@ -224,6 +225,8 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
224
225
  .then(() => {
225
226
  this.stopped = false;
226
227
  this.paused = false;
228
+ if (isPaused)
229
+ this.resume();
227
230
  this.startUpdatePull();
228
231
  return true;
229
232
  });
@@ -240,5 +243,5 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
240
243
  });
241
244
  }
242
245
  }
243
- exports.default = DaumPremiumAdapter;
244
246
  DaumPremiumAdapter.NAME = PROTOCOL_NAME;
247
+ exports.default = DaumPremiumAdapter;
@@ -74,8 +74,9 @@ class Daum8i {
74
74
  this.isLoggingPaused = false;
75
75
  }
76
76
  logEvent(e) {
77
- if (!this.isLoggingPaused)
78
- this.logger.logEvent(e);
77
+ if (this.isLoggingPaused)
78
+ return;
79
+ this.logger.logEvent(e);
79
80
  const w = global.window;
80
81
  if (w === null || w === void 0 ? void 0 : w.DEVICE_DEBUG) {
81
82
  console.log('~~~ DaumPremium', e);
@@ -183,13 +183,13 @@ var ReservedCommands;
183
183
  ReservedCommands[ReservedCommands["RELAX_GET_DATA"] = 15] = "RELAX_GET_DATA";
184
184
  ReservedCommands[ReservedCommands["KEY_PRESSED"] = 16] = "KEY_PRESSED";
185
185
  ReservedCommands[ReservedCommands["PROGRAM_CONTROL"] = 17] = "PROGRAM_CONTROL";
186
- })(ReservedCommands = exports.ReservedCommands || (exports.ReservedCommands = {}));
186
+ })(ReservedCommands || (exports.ReservedCommands = ReservedCommands = {}));
187
187
  var BikeType;
188
188
  (function (BikeType) {
189
189
  BikeType[BikeType["ALLROUND"] = 0] = "ALLROUND";
190
190
  BikeType[BikeType["RACE"] = 1] = "RACE";
191
191
  BikeType[BikeType["MOUNTAIN"] = 2] = "MOUNTAIN";
192
- })(BikeType = exports.BikeType || (exports.BikeType = {}));
192
+ })(BikeType || (exports.BikeType = BikeType = {}));
193
193
  function getBikeType(bikeTypeStr) {
194
194
  if (bikeTypeStr === undefined || bikeTypeStr === null)
195
195
  return BikeType.RACE;
@@ -32,13 +32,13 @@ var SerialCommsState;
32
32
  SerialCommsState[SerialCommsState["Disconnecting"] = 3] = "Disconnecting";
33
33
  SerialCommsState[SerialCommsState["Disconnected"] = 4] = "Disconnected";
34
34
  SerialCommsState[SerialCommsState["Error"] = 5] = "Error";
35
- })(SerialCommsState = exports.SerialCommsState || (exports.SerialCommsState = {}));
35
+ })(SerialCommsState || (exports.SerialCommsState = SerialCommsState = {}));
36
36
  var SendState;
37
37
  (function (SendState) {
38
38
  SendState[SendState["Idle"] = 0] = "Idle";
39
39
  SendState[SendState["Sending"] = 1] = "Sending";
40
40
  SendState[SendState["Receiving"] = 2] = "Receiving";
41
- })(SendState = exports.SendState || (exports.SendState = {}));
41
+ })(SendState || (exports.SendState = SendState = {}));
42
42
  const getBikeProps = (props) => {
43
43
  const { port, interface: ifaceName } = props;
44
44
  let serial;
@@ -140,5 +140,5 @@ class ERGCyclingMode extends power_base_1.default {
140
140
  return data;
141
141
  }
142
142
  }
143
- exports.default = ERGCyclingMode;
144
143
  ERGCyclingMode.isERG = true;
144
+ exports.default = ERGCyclingMode;
@@ -326,5 +326,5 @@ class SerialInterface extends events_1.default {
326
326
  });
327
327
  }
328
328
  }
329
- exports.default = SerialInterface;
330
329
  SerialInterface._instances = [];
330
+ exports.default = SerialInterface;
@@ -9,4 +9,4 @@ var IncyclistCapability;
9
9
  IncyclistCapability["HeartRate"] = "heartrate";
10
10
  IncyclistCapability["Gear"] = "gear";
11
11
  IncyclistCapability["Control"] = "control";
12
- })(IncyclistCapability = exports.IncyclistCapability || (exports.IncyclistCapability = {}));
12
+ })(IncyclistCapability || (exports.IncyclistCapability = IncyclistCapability = {}));
@@ -6,4 +6,4 @@ var RouteType;
6
6
  RouteType["FREE_RIDE"] = "free ride";
7
7
  RouteType["FOLLOW_ROUTE"] = "follow route";
8
8
  RouteType["VIDEO"] = "video";
9
- })(RouteType = exports.RouteType || (exports.RouteType = {}));
9
+ })(RouteType || (exports.RouteType = RouteType = {}));
package/lib/types/user.js CHANGED
@@ -6,4 +6,4 @@ var Gender;
6
6
  Gender["MALE"] = "M";
7
7
  Gender["FEMALE"] = "F";
8
8
  Gender["OTHERS"] = "o";
9
- })(Gender = exports.Gender || (exports.Gender = {}));
9
+ })(Gender || (exports.Gender = Gender = {}));
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "dependencies": {
5
5
  "@serialport/bindings-interface": "^1.2.2",
6
6
  "@serialport/parser-byte-length": "^9.0.1",
7
7
  "@serialport/parser-delimiter": "^9.0.1",
8
8
  "@serialport/parser-readline": "^10.5.0",
9
9
  "@serialport/stream": "^10.5.0",
10
- "incyclist-ant-plus": "^0.1.18",
10
+ "incyclist-ant-plus": "^0.2.0",
11
11
  "win32filetime": "^1.0.2"
12
12
  },
13
13
  "peerDependencies": {
14
- "gd-eventlog": "^0.1.22"
14
+ "gd-eventlog": "^0.1.24"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@serialport/binding-mock": "^10.2.2",
18
18
  "@serialport/bindings-cpp": "^10.8.0",
19
- "@types/jest": "^29.2.4",
20
- "@types/node": "^18.11.18",
21
- "eslint": "^8.30.0",
19
+ "@types/jest": "^29.5.3",
20
+ "@types/node": "^20.5.0",
21
+ "eslint": "^8.47.0",
22
22
  "eslint-config-react-app": "^7.0.1",
23
- "jest": "^29.3.1",
24
- "ts-jest": "^29.0.3",
25
- "typescript": "^4.9.4"
23
+ "jest": "^29.6.2",
24
+ "ts-jest": "^29.1.1",
25
+ "typescript": "^5.1.6"
26
26
  },
27
27
  "scripts": {
28
28
  "lint": "eslint . --ext .ts",