incyclist-devices 3.0.12 → 3.0.13
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/ble/fm/adapter.js +1 -1
- package/lib/cjs/simulator/Simulator.js +3 -0
- package/lib/cjs/types/index.js +0 -1
- package/lib/esm/ble/fm/adapter.js +1 -1
- package/lib/esm/simulator/Simulator.js +3 -0
- package/lib/esm/types/index.js +0 -1
- package/lib/types/ble/fm/adapter.d.ts +1 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/simulator/Simulator.d.ts +4 -2
- package/lib/types/types/index.d.ts +2 -1
- package/package.json +7 -7
|
@@ -117,7 +117,7 @@ class BleFmAdapter extends adapter_js_1.default {
|
|
|
117
117
|
}
|
|
118
118
|
transformData(bikeData) {
|
|
119
119
|
if (bikeData === undefined)
|
|
120
|
-
return;
|
|
120
|
+
return {};
|
|
121
121
|
let distance = 0;
|
|
122
122
|
if (this.distanceInternal !== undefined && bikeData.distanceInternal !== undefined) {
|
|
123
123
|
distance = Math.round(bikeData.distanceInternal - this.distanceInternal);
|
package/lib/cjs/types/index.js
CHANGED
|
@@ -18,5 +18,4 @@ __exportStar(require("./adapter.js"), exports);
|
|
|
18
18
|
__exportStar(require("./capabilities.js"), exports);
|
|
19
19
|
__exportStar(require("./data.js"), exports);
|
|
20
20
|
__exportStar(require("./device.js"), exports);
|
|
21
|
-
__exportStar(require("./interface.js"), exports);
|
|
22
21
|
__exportStar(require("./user.js"), exports);
|
|
@@ -112,7 +112,7 @@ export default class BleFmAdapter extends BleAdapter {
|
|
|
112
112
|
}
|
|
113
113
|
transformData(bikeData) {
|
|
114
114
|
if (bikeData === undefined)
|
|
115
|
-
return;
|
|
115
|
+
return {};
|
|
116
116
|
let distance = 0;
|
|
117
117
|
if (this.distanceInternal !== undefined && bikeData.distanceInternal !== undefined) {
|
|
118
118
|
distance = Math.round(bikeData.distanceInternal - this.distanceInternal);
|
package/lib/esm/types/index.js
CHANGED
|
@@ -34,7 +34,7 @@ export default class BleFmAdapter extends BleAdapter<IndoorBikeData, BleFitnessM
|
|
|
34
34
|
protected updateCyclingModeConfig(): void;
|
|
35
35
|
protected checkCapabilities(): Promise<void>;
|
|
36
36
|
protected updateCapabilitiesFromFeatures(features: IndoorBikeFeatures): void;
|
|
37
|
-
sendUpdate(request:
|
|
37
|
+
sendUpdate(request: UpdateRequest, enforced?: boolean): Promise<UpdateRequest | void>;
|
|
38
38
|
sendInitCommands(): Promise<boolean>;
|
|
39
39
|
protected getFeatureToggle(): import("../../features/features.js").FeatureToggle;
|
|
40
40
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -20,4 +20,6 @@ export * from './direct-connect/index.js';
|
|
|
20
20
|
export * from './features/index.js';
|
|
21
21
|
export * from './proto/zwift_hub.js';
|
|
22
22
|
export * from './bindings/index.js';
|
|
23
|
+
export type * from './types/index.js';
|
|
24
|
+
export type * from './ble/types.js';
|
|
23
25
|
export { IAdapter, IncyclistDevice, IncyclistDeviceAdapter, DeviceSettings, DeviceProperties, AdapterFactory, InterfaceFactory, IncyclistInterface, INTERFACE, InterfaceProps, ICyclingMode, IncyclistAdapterData as DeviceData, IncyclistCapability, calc, MockBinding, BleHrMock, DaumClassicMock, DaumClassicSimulator, DaumClassicMockImpl, DaumPremiumMock, DaumPremiumMockImpl, DaumPremiumMockSimulator };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import SimulatorCyclingMode from '../modes/simulator.js';
|
|
2
2
|
import IncyclistDevice from '../base/adpater.js';
|
|
3
|
-
import { IAdapter, IncyclistBikeData, DeviceProperties, DeviceSettings } from '../types/index.js';
|
|
3
|
+
import { IAdapter, IncyclistBikeData, DeviceProperties, DeviceSettings, ITrainer } from '../types/index.js';
|
|
4
4
|
import { UpdateRequest } from '../modes/types.js';
|
|
5
|
+
import { Sport } from '../types/sport.js';
|
|
5
6
|
interface SimulatorProperties extends DeviceProperties {
|
|
6
7
|
isBot?: boolean;
|
|
7
8
|
settings?: any;
|
|
8
9
|
activity?: any;
|
|
9
10
|
}
|
|
10
|
-
export declare class Simulator extends IncyclistDevice<SimulatorProperties> {
|
|
11
|
+
export declare class Simulator extends IncyclistDevice<SimulatorProperties> implements ITrainer {
|
|
11
12
|
static NAME: string;
|
|
12
13
|
protected static controllers: {
|
|
13
14
|
modes: (typeof SimulatorCyclingMode)[];
|
|
@@ -48,5 +49,6 @@ export declare class Simulator extends IncyclistDevice<SimulatorProperties> {
|
|
|
48
49
|
canEmitData(): boolean;
|
|
49
50
|
calculateDistance(speedKps: any, timeS: any): number;
|
|
50
51
|
sendUpdate(request: any): Promise<UpdateRequest | void>;
|
|
52
|
+
getSupportedSports(): Array<Sport>;
|
|
51
53
|
}
|
|
52
54
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incyclist-devices",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.13",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"lint": "eslint . --ext .ts",
|
|
6
6
|
"build": "npm run build:esm && npm run build:cjs",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"@protobuf-ts/plugin": "^2.11.1",
|
|
31
31
|
"@serialport/binding-mock": "^10.2.2",
|
|
32
32
|
"@serialport/bindings-cpp": "^13.0.1",
|
|
33
|
-
"@stoprocent/noble": "^2.
|
|
34
|
-
"@types/node": "^25.
|
|
35
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
36
|
-
"@typescript-eslint/parser": "^8.
|
|
33
|
+
"@stoprocent/noble": "^2.4.0",
|
|
34
|
+
"@types/node": "^25.6.0",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.59.0",
|
|
36
|
+
"@typescript-eslint/parser": "^8.59.0",
|
|
37
37
|
"@vitest/coverage-v8": "^4.0.18",
|
|
38
38
|
"bonjour-service": "^1.3.0",
|
|
39
|
-
"eslint": "^9.39.
|
|
40
|
-
"protoc": "^33.
|
|
39
|
+
"eslint": "^9.39.4",
|
|
40
|
+
"protoc": "^33.6.0",
|
|
41
41
|
"ts-node": "^10.9.2",
|
|
42
42
|
"typescript": "^5.9.3",
|
|
43
43
|
"vitest": "^4.0.18"
|