incyclist-devices 1.4.11 → 1.4.12

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.
@@ -148,12 +148,12 @@ class KettlerRacerAdapter extends Device_1.default {
148
148
  }
149
149
  setBaudrate(baudrate) {
150
150
  return __awaiter(this, void 0, void 0, function* () {
151
- return this.send('startTraining', `BR${baudrate}`);
151
+ return this.send(`setBaudrate(${baudrate})`, `BR${baudrate}`);
152
152
  });
153
153
  }
154
154
  setPower(power) {
155
155
  return __awaiter(this, void 0, void 0, function* () {
156
- return this.send('setPower', `PW${power}`);
156
+ return this.send(`setPower(${power})`, `PW${power}`);
157
157
  });
158
158
  }
159
159
  getExtendedStatus() {
@@ -166,7 +166,7 @@ class KettlerRacerAdapter extends Device_1.default {
166
166
  }
167
167
  getStatus() {
168
168
  return __awaiter(this, void 0, void 0, function* () {
169
- return this.send('getExtendedStatus', 'ST').then(response => {
169
+ return this.send('getStatus', 'ST').then(response => {
170
170
  const data = this.parseStatus(response);
171
171
  return data;
172
172
  });
@@ -247,14 +247,86 @@ class KettlerRacerAdapter extends Device_1.default {
247
247
  iv = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
248
248
  reject(new Error(`timeout`));
249
249
  }), 5000);
250
- if (!info.pcMode)
251
- info.pcMode = yield this.setComputerMode();
252
- if (!info.interface)
253
- info.interface = yield this.getInterface();
254
- if (!info.version)
255
- info.version = yield this.getVersion();
256
- if (!info.id)
257
- info.id = yield this.getIdentifier();
250
+ try {
251
+ yield this.getVersion();
252
+ }
253
+ catch (e) { }
254
+ try {
255
+ yield this.getInterface();
256
+ }
257
+ catch (e) { }
258
+ try {
259
+ yield this.getIdentifier();
260
+ }
261
+ catch (e) { }
262
+ try {
263
+ yield this.getExtendedStatus();
264
+ }
265
+ catch (e) { }
266
+ try {
267
+ yield this.getStatus();
268
+ }
269
+ catch (e) { }
270
+ try {
271
+ yield this.setClientMode();
272
+ }
273
+ catch (e) { }
274
+ try {
275
+ yield this.getVersion();
276
+ }
277
+ catch (e) { }
278
+ try {
279
+ yield this.getInterface();
280
+ }
281
+ catch (e) { }
282
+ try {
283
+ yield this.getIdentifier();
284
+ }
285
+ catch (e) { }
286
+ try {
287
+ yield this.getExtendedStatus();
288
+ }
289
+ catch (e) { }
290
+ try {
291
+ yield this.getStatus();
292
+ }
293
+ catch (e) { }
294
+ try {
295
+ yield this.setPower(100);
296
+ }
297
+ catch (e) { }
298
+ try {
299
+ yield this.reset();
300
+ }
301
+ catch (e) { }
302
+ try {
303
+ yield this.setComputerMode();
304
+ }
305
+ catch (e) { }
306
+ try {
307
+ yield this.getVersion();
308
+ }
309
+ catch (e) { }
310
+ try {
311
+ yield this.getInterface();
312
+ }
313
+ catch (e) { }
314
+ try {
315
+ yield this.getIdentifier();
316
+ }
317
+ catch (e) { }
318
+ try {
319
+ yield this.getExtendedStatus();
320
+ }
321
+ catch (e) { }
322
+ try {
323
+ yield this.getStatus();
324
+ }
325
+ catch (e) { }
326
+ try {
327
+ yield this.setPower(100);
328
+ }
329
+ catch (e) { }
258
330
  clearTimeout(iv);
259
331
  resolve(info);
260
332
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "dependencies": {
5
5
  "@serialport/parser-byte-length": "^9.0.1",
6
6
  "@serialport/parser-delimiter": "^9.0.1",