incyclist-devices 2.1.29 → 2.1.30
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.
|
@@ -16,6 +16,7 @@ export default class AntFEAdapter extends AntAdapter<FitnessEquipmentSensorState
|
|
|
16
16
|
protected startProps: AntDeviceProperties;
|
|
17
17
|
protected promiseReconnect: Promise<boolean>;
|
|
18
18
|
protected promiseSendUpdate: Promise<boolean>;
|
|
19
|
+
protected promiseStop: Promise<boolean>;
|
|
19
20
|
constructor(settings: AntDeviceSettings, props?: AntDeviceProperties);
|
|
20
21
|
getDisplayName(): string;
|
|
21
22
|
isReconnecting(): boolean;
|
package/lib/antv2/fe/adapter.js
CHANGED
|
@@ -40,6 +40,8 @@ class AntFEAdapter extends adapter_1.default {
|
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
if ((this.paused || this.isReconnecting()) && !forced)
|
|
42
42
|
return;
|
|
43
|
+
if (this.promiseStop)
|
|
44
|
+
return;
|
|
43
45
|
if (this.promiseSendUpdate) {
|
|
44
46
|
this.logEvent({ message: 'send bike update skipped', device: this.getName(), request, reason: 'busy' });
|
|
45
47
|
return;
|
|
@@ -221,9 +223,15 @@ class AntFEAdapter extends adapter_1.default {
|
|
|
221
223
|
fe.setSendTimeout(5000);
|
|
222
224
|
}
|
|
223
225
|
stop() {
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
const _super = Object.create(null, {
|
|
227
|
+
stop: { get: () => super.stop }
|
|
228
|
+
});
|
|
229
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
+
this.promiseStop = _super.stop.call(this);
|
|
231
|
+
this.sensorConnected = false;
|
|
232
|
+
const stopped = yield this.promiseStop;
|
|
233
|
+
return stopped;
|
|
234
|
+
});
|
|
227
235
|
}
|
|
228
236
|
reconnect() {
|
|
229
237
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -20,6 +20,7 @@ export default class DaumPremiumAdapter extends DaumAdapter<SerialDeviceSettings
|
|
|
20
20
|
performCheck(): Promise<boolean>;
|
|
21
21
|
getStartRetries(): number;
|
|
22
22
|
getStartRetryTimeout(): number;
|
|
23
|
+
restart(pause?: number): Promise<boolean>;
|
|
23
24
|
performStart(props?: DaumPremiumDeviceProperties, _isRelaunch?: boolean, wasPaused?: boolean): Promise<boolean>;
|
|
24
25
|
requiresProgramUpload(): boolean;
|
|
25
26
|
getCurrentBikeData(): Promise<IncyclistBikeData>;
|
|
@@ -122,6 +122,16 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
|
|
|
122
122
|
getStartRetryTimeout() {
|
|
123
123
|
return START_RETRY_TIMEOUT;
|
|
124
124
|
}
|
|
125
|
+
restart(pause) {
|
|
126
|
+
const _super = Object.create(null, {
|
|
127
|
+
restart: { get: () => super.restart }
|
|
128
|
+
});
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
if (this.requiresProgramUpload())
|
|
131
|
+
return false;
|
|
132
|
+
return yield _super.restart.call(this, pause);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
125
135
|
performStart(props = {}, _isRelaunch = false, wasPaused = false) {
|
|
126
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
137
|
this.setBikeProps(props);
|