incyclist-devices 2.3.27 → 2.3.28
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FitnessEquipmentSensorState, Profile } from "incyclist-ant-plus";
|
|
2
2
|
import AntAdapter from "../base/adapter";
|
|
3
|
-
import { UpdateRequest } from '../../modes/types';
|
|
3
|
+
import ICyclingMode, { UpdateRequest } from '../../modes/types';
|
|
4
4
|
import { AntDeviceProperties, AntDeviceSettings, LegacyProfile } from "../types";
|
|
5
5
|
import { IncyclistBikeData, ControllerConfig } from "../../types";
|
|
6
6
|
interface AntFEStartDeviceProperties extends AntDeviceProperties {
|
|
@@ -20,6 +20,7 @@ export default class AntFEAdapter extends AntAdapter<FitnessEquipmentSensorState
|
|
|
20
20
|
constructor(settings: AntDeviceSettings, props?: AntDeviceProperties);
|
|
21
21
|
getDisplayName(): string;
|
|
22
22
|
isReconnecting(): boolean;
|
|
23
|
+
getDefaultCyclingMode(): ICyclingMode;
|
|
23
24
|
sendUpdate(request: UpdateRequest): Promise<UpdateRequest | void>;
|
|
24
25
|
onDeviceData(deviceData: FitnessEquipmentSensorState): void;
|
|
25
26
|
mapData(deviceData: FitnessEquipmentSensorState): IncyclistBikeData;
|
package/lib/antv2/fe/adapter.js
CHANGED
|
@@ -18,6 +18,7 @@ const ant_fe_adv_st_mode_1 = __importDefault(require("../../modes/ant-fe-adv-st-
|
|
|
18
18
|
const consts_1 = require("../../base/consts");
|
|
19
19
|
const antble_erg_1 = __importDefault(require("../../modes/antble-erg"));
|
|
20
20
|
const antble_smarttrainer_1 = __importDefault(require("../../modes/antble-smarttrainer"));
|
|
21
|
+
const power_meter_1 = __importDefault(require("../../modes/power-meter"));
|
|
21
22
|
const DEFAULT_BIKE_WEIGHT_MOUNTAIN = 14.5;
|
|
22
23
|
class AntFEAdapter extends adapter_1.default {
|
|
23
24
|
constructor(settings, props) {
|
|
@@ -36,6 +37,11 @@ class AntFEAdapter extends adapter_1.default {
|
|
|
36
37
|
isReconnecting() {
|
|
37
38
|
return this.promiseReconnect !== null && this.promiseReconnect !== undefined;
|
|
38
39
|
}
|
|
40
|
+
getDefaultCyclingMode() {
|
|
41
|
+
if (this.props.capabilities && this.props.capabilities.indexOf(types_1.IncyclistCapability.Control) === -1)
|
|
42
|
+
return new power_meter_1.default(this);
|
|
43
|
+
return super.getDefaultCyclingMode();
|
|
44
|
+
}
|
|
39
45
|
sendUpdate(request) {
|
|
40
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
47
|
if ((this.paused || this.isReconnecting()) && !request.forced)
|
|
@@ -4,7 +4,7 @@ import { DaumSerialComms } from './types';
|
|
|
4
4
|
import { SerialIncyclistDevice } from '../base/adapter';
|
|
5
5
|
import SerialInterface from '../base/serial-interface';
|
|
6
6
|
import EventEmitter from 'events';
|
|
7
|
-
import { UpdateRequest } from '../../modes/types';
|
|
7
|
+
import ICyclingMode, { UpdateRequest } from '../../modes/types';
|
|
8
8
|
export default class DaumAdapter<S extends SerialDeviceSettings, P extends DeviceProperties, C extends DaumSerialComms> extends SerialIncyclistDevice<P> {
|
|
9
9
|
protected static controllers: ControllerConfig;
|
|
10
10
|
comms: C;
|
|
@@ -27,6 +27,7 @@ export default class DaumAdapter<S extends SerialDeviceSettings, P extends Devic
|
|
|
27
27
|
constructor(settings: S, props?: P);
|
|
28
28
|
getPort(): string;
|
|
29
29
|
getSerialInterface(): SerialInterface;
|
|
30
|
+
getDefaultCyclingMode(): ICyclingMode;
|
|
30
31
|
sendInitCommands(): Promise<boolean>;
|
|
31
32
|
getCurrentBikeData(): Promise<IncyclistBikeData>;
|
|
32
33
|
getComms(): C;
|
|
@@ -50,6 +50,11 @@ class DaumAdapter extends adapter_1.SerialIncyclistDevice {
|
|
|
50
50
|
var _a;
|
|
51
51
|
return (_a = this.comms) === null || _a === void 0 ? void 0 : _a.serial;
|
|
52
52
|
}
|
|
53
|
+
getDefaultCyclingMode() {
|
|
54
|
+
if (this.props.capabilities && this.props.capabilities.indexOf(types_1.IncyclistCapability.Control) === -1)
|
|
55
|
+
return new daum_power_1.default(this);
|
|
56
|
+
return super.getDefaultCyclingMode();
|
|
57
|
+
}
|
|
53
58
|
sendInitCommands() {
|
|
54
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
60
|
if (this.started && !this.stopped) {
|