incyclist-devices 2.4.0 → 2.4.2

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.
@@ -72,21 +72,33 @@ class SmartTrainerCyclingMode extends power_base_1.default {
72
72
  }
73
73
  getConfig() {
74
74
  const config = super.getConfig();
75
- if (!this.getFeatureToogle().has('VirtualShifting')) {
76
- return config;
77
- }
75
+ const virtShiftEnabled = this.getFeatureToogle().has('VirtualShifting');
78
76
  let virtshift = config.properties.find(p => p.key === 'virtshift');
79
77
  let startGear = config.properties.find(p => p.key === 'startGear');
80
- if (!virtshift) {
81
- virtshift = { key: 'virtshift', name: 'Virtual Shifting', description: 'Enable virtual shifting', type: types_1.CyclingModeProperyType.SingleSelect, options: ['Disabled', 'Incyclist', 'Mixed'], default: 'Disabled' };
78
+ if (!virtshift && !this.adapter.supportsVirtualShifting()) {
79
+ const options = virtShiftEnabled ? [
80
+ 'Disabled',
81
+ { key: 'Incyclist', display: 'App only (beta)' },
82
+ { key: 'Mixed', display: 'App + Bike' }
83
+ ] :
84
+ [
85
+ 'Disabled',
86
+ { key: 'Mixed', display: 'Enabled' }
87
+ ];
88
+ virtshift = { key: 'virtshift', name: 'Virtual Shifting', description: 'Enable virtual shifting', type: types_1.CyclingModeProperyType.SingleSelect, options, default: 'Disabled' };
82
89
  config.properties.push(virtshift);
83
90
  }
84
- if (this.adapter.supportsVirtualShifting()) {
91
+ if (!virtshift && virtShiftEnabled && this.adapter.supportsVirtualShifting()) {
85
92
  virtshift.default = 'Enabled';
86
- virtshift.options = ['Disabled', 'Incyclist', 'SmartTrainer', 'Mixed'];
93
+ virtshift.options = [
94
+ 'Disabled',
95
+ { key: 'Incyclist', display: 'App only (beta)' },
96
+ { key: 'Mixed', display: 'App + Bike' },
97
+ { key: 'SmartTrainer', display: 'SmartTreiner (beta)' }
98
+ ];
87
99
  virtshift.default = 'SmartTrainer';
88
100
  }
89
- if (!startGear) {
101
+ if (virtshift && !startGear) {
90
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' };
91
103
  config.properties.push(startGear);
92
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "dependencies": {
5
5
  "@protobuf-ts/runtime": "^2.11.1",
6
6
  "@serialport/bindings-interface": "^1.2.2",