incyclist-services 1.4.1 → 1.4.2
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.
|
@@ -190,13 +190,13 @@ let DeviceConfigurationService = (() => {
|
|
|
190
190
|
var _a, _b;
|
|
191
191
|
let udid = this.getUdid(deviceSettings);
|
|
192
192
|
const { legacy = false } = props || {};
|
|
193
|
-
this.logEvent({ message: 'add device', udid, deviceSettings, legacy });
|
|
194
193
|
const deviceAlreadyExists = udid !== undefined;
|
|
195
194
|
let adapter;
|
|
196
195
|
if (deviceAlreadyExists && this.adapters[udid]) {
|
|
197
196
|
adapter = this.adapters[udid];
|
|
198
197
|
}
|
|
199
198
|
else {
|
|
199
|
+
this.logEvent({ message: 'add device', udid, deviceSettings, legacy });
|
|
200
200
|
adapter = this.getAdapterFromSetting(deviceSettings);
|
|
201
201
|
if (!adapter) {
|
|
202
202
|
this.logEvent({ message: 'could not create adapter' });
|
|
@@ -940,6 +940,7 @@ class DevicePairingService extends service_2.IncyclistService {
|
|
|
940
940
|
const stopPromises = [];
|
|
941
941
|
interfaces.forEach(i => stopPromises.push(this.stopAdaptersOnInterface(i)));
|
|
942
942
|
yield Promise.allSettled(stopPromises);
|
|
943
|
+
this.deregisterScanningDataHandlers();
|
|
943
944
|
this.logEvent({ message: 'Start Scanning', interfaces: interfaces.join(','), props });
|
|
944
945
|
this.initScanningCallbacks();
|
|
945
946
|
const timeout = props.enforcedScan ? 1000 * 60 * 60 : undefined;
|
|
@@ -13,6 +13,7 @@ export declare class DeviceRideService extends IncyclistService {
|
|
|
13
13
|
protected promiseSendUpdate: Promise<UpdateRequest | void>[];
|
|
14
14
|
protected originalMode: CyclingMode;
|
|
15
15
|
protected deviceDataHandler: any;
|
|
16
|
+
protected lazyInitDone: boolean;
|
|
16
17
|
constructor();
|
|
17
18
|
protected waitForInit(): Promise<void>;
|
|
18
19
|
lazyInit(): Promise<void>;
|
|
@@ -83,6 +83,7 @@ let DeviceRideService = (() => {
|
|
|
83
83
|
this.deviceDataHandler = this.onData.bind(this);
|
|
84
84
|
this.initizialized = false;
|
|
85
85
|
this.simulatorEnforced = false;
|
|
86
|
+
this.lazyInitDone = false;
|
|
86
87
|
this.debug = false;
|
|
87
88
|
}
|
|
88
89
|
waitForInit() {
|
|
@@ -96,6 +97,8 @@ let DeviceRideService = (() => {
|
|
|
96
97
|
}
|
|
97
98
|
lazyInit() {
|
|
98
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
if (this.lazyInitDone)
|
|
101
|
+
return;
|
|
99
102
|
if (!this.initizialized) {
|
|
100
103
|
yield this.waitForInit();
|
|
101
104
|
}
|
|
@@ -105,6 +108,7 @@ let DeviceRideService = (() => {
|
|
|
105
108
|
const handleDeviceDeleted = this.onDeviceDeleted.bind(this);
|
|
106
109
|
config.on('mode-changed', handleModeChange);
|
|
107
110
|
config.on('device-deleted', handleDeviceDeleted);
|
|
111
|
+
this.lazyInitDone = true;
|
|
108
112
|
});
|
|
109
113
|
}
|
|
110
114
|
getAdapterStateInfo(adapterInfo) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incyclist-services",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"gd-eventlog": "^0.1.26"
|
|
6
6
|
},
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"axios": "^1.7.7",
|
|
45
|
-
"incyclist-devices": "^2.3.
|
|
45
|
+
"incyclist-devices": "^2.3.2",
|
|
46
46
|
"promise.any": "^2.0.6",
|
|
47
47
|
"semver": "^7.6.3",
|
|
48
48
|
"tcx-builder": "^1.1.1",
|