incyclist-devices 2.4.3 → 2.4.4

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.
@@ -89,14 +89,14 @@ class SmartTrainerCyclingMode extends power_base_1.default {
89
89
  config.properties.push(virtshift);
90
90
  }
91
91
  if (!virtshift && virtShiftEnabled && this.adapter.supportsVirtualShifting()) {
92
- virtshift.default = 'Enabled';
93
- virtshift.options = [
92
+ const options = [
94
93
  'Disabled',
95
94
  { key: 'Incyclist', display: 'App only (beta)' },
96
95
  { key: 'Mixed', display: 'App + Bike' },
97
96
  { key: 'SmartTrainer', display: 'SmartTreiner (beta)' }
98
97
  ];
99
- virtshift.default = 'SmartTrainer';
98
+ virtshift = { key: 'virtshift', name: 'Virtual Shifting', description: 'Enable virtual shifting', type: types_1.CyclingModeProperyType.SingleSelect, options, default: 'SmartTrainer' };
99
+ config.properties.push(virtshift);
100
100
  }
101
101
  if (virtshift && !startGear) {
102
102
  startGear = { key: 'startGear', name: 'Initial Gear', description: 'Initial Gear', type: types_1.CyclingModeProperyType.Integer, default: 12, min: 1, max: 24, condition: (s) => (s === null || s === void 0 ? void 0 : s.virtshift) === 'Incyclist' || (s === null || s === void 0 ? void 0 : s.virtshift) === 'SmartTrainer' };
@@ -358,24 +358,29 @@ class SmartTrainerCyclingMode extends power_base_1.default {
358
358
  }
359
359
  }
360
360
  getVirtualShiftMode() {
361
- if (!this.getFeatureToogle().has('VirtualShifting')) {
362
- return 'Disabled';
363
- }
364
- const virtshiftMode = this.getSetting('virtshift');
365
- if (virtshiftMode === 'Disabled') {
366
- return 'Disabled';
367
- }
368
- else if (virtshiftMode === 'Incyclist') {
369
- return 'Simulated';
370
- }
371
- else if (virtshiftMode === 'SmartTrainer') {
372
- return 'Adapter';
373
- }
374
- else if (virtshiftMode === 'Mixed') {
375
- return 'SlopeDelta';
361
+ try {
362
+ if (!this.getFeatureToogle().has('VirtualShifting')) {
363
+ return 'Disabled';
364
+ }
365
+ const virtshiftMode = this.getSetting('virtshift');
366
+ if (virtshiftMode === 'Disabled') {
367
+ return 'Disabled';
368
+ }
369
+ else if (virtshiftMode === 'Incyclist') {
370
+ return 'Simulated';
371
+ }
372
+ else if (virtshiftMode === 'SmartTrainer') {
373
+ return 'Adapter';
374
+ }
375
+ else if (virtshiftMode === 'Mixed') {
376
+ return 'SlopeDelta';
377
+ }
378
+ else if (virtshiftMode === 'Enabled') {
379
+ return this.adapter.supportsVirtualShifting() ? 'Adapter' : 'Simulated';
380
+ }
376
381
  }
377
- else if (virtshiftMode === 'Enabled') {
378
- return this.adapter.supportsVirtualShifting() ? 'Adapter' : 'Simulated';
382
+ catch (err) {
383
+ this.logger.logEvent({ message: 'error', fn: 'getVirtualShiftMode', error: err.message, stack: err.stack });
379
384
  }
380
385
  return 'Disabled';
381
386
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "dependencies": {
5
5
  "@protobuf-ts/runtime": "^2.11.1",
6
6
  "@serialport/bindings-interface": "^1.2.2",