incyclist-devices 2.3.22 → 2.3.24

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.
@@ -46,6 +46,7 @@ export default class BleAdapter<TDeviceData extends BleDeviceData, TDevice exten
46
46
  protected waitForInitialData(startupTimeout: any): Promise<void>;
47
47
  protected checkCapabilities(): Promise<void>;
48
48
  protected initControl(_props?: BleStartProperties): Promise<void>;
49
+ protected getStartLogProps(props: BleStartProperties): BleStartProperties;
49
50
  protected startAdapter(startProps?: BleStartProperties): Promise<boolean>;
50
51
  startSensor(): Promise<boolean>;
51
52
  protected onDisconnectDone(): Promise<void>;
@@ -256,9 +256,14 @@ class BleAdapter extends adpater_1.default {
256
256
  return __awaiter(this, void 0, void 0, function* () {
257
257
  });
258
258
  }
259
+ getStartLogProps(props) {
260
+ const { user, userWeight, bikeWeight, timeout, wheelDiameter, restart, scanOnly } = props !== null && props !== void 0 ? props : {};
261
+ return { user, userWeight, bikeWeight, wheelDiameter, timeout, restart, scanOnly };
262
+ }
259
263
  startAdapter(startProps) {
260
264
  return __awaiter(this, void 0, void 0, function* () {
261
265
  const props = this.getStartProps(startProps);
266
+ const logProps = this.getStartLogProps(props);
262
267
  const { timeout = this.getDefaultStartupTimeout() } = startProps !== null && startProps !== void 0 ? startProps : {};
263
268
  const wasPaused = this.paused;
264
269
  const preCheckResult = yield this.startPreChecks(props);
@@ -272,16 +277,16 @@ class BleAdapter extends adpater_1.default {
272
277
  yield (0, utils_1.resolveNextTick)();
273
278
  return false;
274
279
  }
275
- this.logEvent({ message: 'starting device', device: this.getName(), interface: this.getInterface(), props, isStarted: this.started });
280
+ this.logEvent({ message: 'starting device', device: this.getName(), interface: this.getInterface(), props: logProps, isStarted: this.started });
276
281
  try {
277
282
  this.resetData();
278
283
  this.stopped = false;
279
284
  const connected = yield this.startSensor();
280
285
  if (connected) {
281
- this.logEvent({ message: 'peripheral connected', device: this.getName(), interface: this.getInterface(), props });
286
+ this.logEvent({ message: 'peripheral connected', device: this.getName(), interface: this.getInterface() });
282
287
  }
283
288
  else {
284
- this.logEvent({ message: 'peripheral connection failed', device: this.getName(), interface: this.getInterface(), reason: 'unknown', props });
289
+ this.logEvent({ message: 'peripheral connection failed', device: this.getName(), interface: this.getInterface(), reason: 'unknown' });
285
290
  this.stopped = true;
286
291
  return false;
287
292
  }
@@ -207,7 +207,7 @@ class BleFitnessMachineDevice extends sensor_1.TBleSensor {
207
207
  }
208
208
  }
209
209
  catch (err) {
210
- this.logEvent({ message: 'error', fn: 'parseIndoorBikeData()', data: data.toString('hex'), offset, error: err.message | err, stack: err.stack });
210
+ this.logEvent({ message: 'error', fn: 'parseIndoorBikeData()', data: data.toString('hex'), offset, error: err.message, stack: err.stack });
211
211
  }
212
212
  return Object.assign(Object.assign({}, this.data), { raw: `2ad2:${data.toString('hex')}` });
213
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "2.3.22",
3
+ "version": "2.3.24",
4
4
  "dependencies": {
5
5
  "@serialport/bindings-interface": "^1.2.2",
6
6
  "@serialport/parser-byte-length": "^9.0.1",