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.
- package/lib/modes/antble-smarttrainer.js +25 -20
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
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
|
-
|
|
378
|
-
|
|
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
|
}
|