incyclist-devices 2.2.2 → 2.2.3
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.
|
@@ -20,7 +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
|
-
sendUpdate(request: UpdateRequest
|
|
23
|
+
sendUpdate(request: UpdateRequest): Promise<UpdateRequest | void>;
|
|
24
24
|
onDeviceData(deviceData: FitnessEquipmentSensorState): void;
|
|
25
25
|
mapData(deviceData: FitnessEquipmentSensorState): IncyclistBikeData;
|
|
26
26
|
transformData(adapterData: IncyclistBikeData, deviceData: FitnessEquipmentSensorState): void;
|
package/lib/antv2/fe/adapter.js
CHANGED
|
@@ -36,9 +36,9 @@ class AntFEAdapter extends adapter_1.default {
|
|
|
36
36
|
isReconnecting() {
|
|
37
37
|
return this.promiseReconnect !== null && this.promiseReconnect !== undefined;
|
|
38
38
|
}
|
|
39
|
-
sendUpdate(request
|
|
39
|
+
sendUpdate(request) {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
if ((this.paused || this.isReconnecting()) && !forced)
|
|
41
|
+
if ((this.paused || this.isReconnecting()) && !request.forced)
|
|
42
42
|
return;
|
|
43
43
|
if (this.promiseStop)
|
|
44
44
|
return;
|
|
@@ -269,7 +269,7 @@ class AntFEAdapter extends adapter_1.default {
|
|
|
269
269
|
if (this.getCyclingMode() instanceof antble_erg_1.default) {
|
|
270
270
|
const power = this.data.power;
|
|
271
271
|
const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
|
|
272
|
-
yield this.sendUpdate(request, true);
|
|
272
|
+
yield this.sendUpdate(Object.assign(Object.assign({}, request), { forced: true }));
|
|
273
273
|
return true;
|
|
274
274
|
}
|
|
275
275
|
}
|
package/lib/antv2/pwr/adapter.js
CHANGED
|
@@ -59,7 +59,7 @@ class AntPwrAdapter extends adapter_1.default {
|
|
|
59
59
|
sendUpdate(request) {
|
|
60
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
61
|
try {
|
|
62
|
-
if (this.isPaused() || this.isStopped())
|
|
62
|
+
if ((this.isPaused() || this.isStopped()) && !request.forced)
|
|
63
63
|
return;
|
|
64
64
|
return yield this.getCyclingMode().sendBikeUpdate(request);
|
|
65
65
|
}
|
package/lib/base/adpater.js
CHANGED
|
@@ -197,7 +197,7 @@ class IncyclistDevice extends events_1.default {
|
|
|
197
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
198
198
|
if (!this.isControllable())
|
|
199
199
|
return;
|
|
200
|
-
if (this.isPaused() || this.isStopped())
|
|
200
|
+
if (!request.enforced && (this.isPaused() || this.isStopped()))
|
|
201
201
|
return;
|
|
202
202
|
if (!this.hasCapability(types_1.IncyclistCapability.Control))
|
|
203
203
|
return yield this.getCyclingMode().sendBikeUpdate(request);
|
package/lib/modes/types.d.ts
CHANGED