incyclist-services 1.9.19 → 1.9.21
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/cjs/ride/display/service.js +1 -0
- package/lib/esm/devices/pairing/conflict.js +33 -0
- package/lib/esm/devices/ride/timeouts.js +5 -0
- package/lib/esm/ride/display/service.js +1 -0
- package/lib/types/devices/pairing/conflict.d.ts +10 -0
- package/lib/types/devices/ride/timeouts.d.ts +2 -0
- package/package.json +2 -2
|
@@ -1004,6 +1004,7 @@ let RideDisplayService = (() => {
|
|
|
1004
1004
|
devices.off('start-update', h.deviceStartUpdateHandler);
|
|
1005
1005
|
devices.off('start-error', h.deviceStartNOKHandler);
|
|
1006
1006
|
devices.off('cycling-mode-toggle', h.toggleCyclingModeHandler);
|
|
1007
|
+
devices.off('key-pressed', h.deviceKeyPressedHandler);
|
|
1007
1008
|
delete this.startDeviceHandlers;
|
|
1008
1009
|
}
|
|
1009
1010
|
devicePowerUp(inc, gearFallback = true) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const CAPABILITY_TITLES = {
|
|
2
|
+
control: 'Resistance',
|
|
3
|
+
power: 'Power',
|
|
4
|
+
speed: 'Speed',
|
|
5
|
+
cadence: 'Cadence',
|
|
6
|
+
heartrate: 'Heartrate',
|
|
7
|
+
app_control: 'Controller',
|
|
8
|
+
};
|
|
9
|
+
const joinNames = (names) => {
|
|
10
|
+
if (names.length <= 1)
|
|
11
|
+
return names.join('');
|
|
12
|
+
return `${names.slice(0, -1).join(', ')} and ${names.at(-1)}`;
|
|
13
|
+
};
|
|
14
|
+
export const getCapabilityTitle = (capability) => CAPABILITY_TITLES[capability] ?? capability;
|
|
15
|
+
export const getConflictStepTitle = (deviceName) => `${deviceName} can also measure more`;
|
|
16
|
+
export const getConflictStepSubline = (origin, deviceName, filled) => {
|
|
17
|
+
const names = filled.map(getCapabilityTitle);
|
|
18
|
+
const freed = names.length > 1 ? `${joinNames(names)} were free and now use` : `${joinNames(names)} was free and now uses`;
|
|
19
|
+
if (origin === 'manual') {
|
|
20
|
+
const full = names.length > 0
|
|
21
|
+
? `Choose which device to use for each. ${freed} ${deviceName}.`
|
|
22
|
+
: 'Choose which device to use for each.';
|
|
23
|
+
return { full, short: 'Choose which device to use for each.' };
|
|
24
|
+
}
|
|
25
|
+
const short = 'Nothing changes until you choose.';
|
|
26
|
+
const full = names.length > 0
|
|
27
|
+
? `${freed} it. Choose for the rest; nothing changes until you do.`
|
|
28
|
+
: short;
|
|
29
|
+
return { full, short };
|
|
30
|
+
};
|
|
31
|
+
export const getConflictKeepLabel = (currentName) => `Keep ${currentName}`;
|
|
32
|
+
export const getConflictReplaceLabel = (deviceName) => `Use ${deviceName}`;
|
|
33
|
+
export const getConflictQueuedText = (queued) => queued > 0 ? `${queued} more` : undefined;
|
|
@@ -1001,6 +1001,7 @@ let RideDisplayService = (() => {
|
|
|
1001
1001
|
devices.off('start-update', h.deviceStartUpdateHandler);
|
|
1002
1002
|
devices.off('start-error', h.deviceStartNOKHandler);
|
|
1003
1003
|
devices.off('cycling-mode-toggle', h.toggleCyclingModeHandler);
|
|
1004
|
+
devices.off('key-pressed', h.deviceKeyPressedHandler);
|
|
1004
1005
|
delete this.startDeviceHandlers;
|
|
1005
1006
|
}
|
|
1006
1007
|
devicePowerUp(inc, gearFallback = true) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SelectionConflict } from './model';
|
|
2
|
+
export declare const getCapabilityTitle: (capability: string) => string;
|
|
3
|
+
export declare const getConflictStepTitle: (deviceName: string) => string;
|
|
4
|
+
export declare const getConflictStepSubline: (origin: SelectionConflict["origin"], deviceName: string, filled: ReadonlyArray<string>) => {
|
|
5
|
+
full: string;
|
|
6
|
+
short: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const getConflictKeepLabel: (currentName: string) => string;
|
|
9
|
+
export declare const getConflictReplaceLabel: (deviceName: string) => string;
|
|
10
|
+
export declare const getConflictQueuedText: (queued: number) => string | undefined;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incyclist-services",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.21",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"gd-eventlog": "^0.1.27"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@garmin/fitsdk": "^21.221.0",
|
|
9
9
|
"axios": "^1.21.0",
|
|
10
|
-
"incyclist-devices": "^3.0.
|
|
10
|
+
"incyclist-devices": "^3.0.45",
|
|
11
11
|
"promise.any": "^2.0.6",
|
|
12
12
|
"semver": "^7.7.4",
|
|
13
13
|
"tcx-builder": "^1.1.1",
|