incyclist-devices 1.4.7 → 1.4.8
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/daum/DaumAdapter.js +10 -3
- package/package.json +1 -1
package/lib/daum/DaumAdapter.js
CHANGED
|
@@ -147,13 +147,17 @@ class DaumAdapterBase extends Device_1.default {
|
|
|
147
147
|
return;
|
|
148
148
|
if (this.ignoreBike && this.ignoreHrm && this.ignorePower)
|
|
149
149
|
return;
|
|
150
|
-
|
|
150
|
+
const ivSync = setInterval(() => {
|
|
151
151
|
this.bikeSync();
|
|
152
152
|
}, 1000);
|
|
153
|
-
|
|
153
|
+
const ivUpdate = setInterval(() => {
|
|
154
154
|
this.sendData();
|
|
155
155
|
this.refreshRequests();
|
|
156
156
|
}, 1000);
|
|
157
|
+
this.iv = {
|
|
158
|
+
sync: ivSync,
|
|
159
|
+
update: ivUpdate
|
|
160
|
+
};
|
|
157
161
|
}
|
|
158
162
|
connect() {
|
|
159
163
|
if (!this.bike.isConnected())
|
|
@@ -173,7 +177,10 @@ class DaumAdapterBase extends Device_1.default {
|
|
|
173
177
|
return new Promise((resolve, reject) => {
|
|
174
178
|
try {
|
|
175
179
|
if (this.iv) {
|
|
176
|
-
|
|
180
|
+
if (this.iv.sync)
|
|
181
|
+
clearInterval(this.iv.sync);
|
|
182
|
+
if (this.iv.update)
|
|
183
|
+
clearInterval(this.iv.update);
|
|
177
184
|
this.iv = undefined;
|
|
178
185
|
}
|
|
179
186
|
this.logEvent({ message: 'stop request completed' });
|