incyclist-devices 2.3.11 → 2.3.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.
- package/lib/ble/fm/adapter.js +7 -7
- package/package.json +1 -1
package/lib/ble/fm/adapter.js
CHANGED
|
@@ -229,19 +229,19 @@ class BleFmAdapter extends adapter_1.default {
|
|
|
229
229
|
return __awaiter(this, arguments, void 0, function* (request, enforced = false) {
|
|
230
230
|
if (!enforced && (this.paused || !this.device))
|
|
231
231
|
return;
|
|
232
|
-
if (!this.hasCapability(types_1.IncyclistCapability.Control))
|
|
233
|
-
return;
|
|
234
232
|
if (!enforced && (this.stopped && !this.isStarting()))
|
|
235
233
|
return;
|
|
236
234
|
try {
|
|
237
235
|
const update = this.getCyclingMode().sendBikeUpdate(request);
|
|
238
236
|
this.logEvent({ message: 'send bike update requested', profile: this.getProfile(), update, request });
|
|
239
237
|
const device = this.getSensor();
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
238
|
+
if (this.hasCapability(types_1.IncyclistCapability.Control)) {
|
|
239
|
+
if (update.slope !== undefined) {
|
|
240
|
+
yield device.setSlope(update.slope);
|
|
241
|
+
}
|
|
242
|
+
if (update.targetPower !== undefined) {
|
|
243
|
+
yield device.setTargetPower(update.targetPower);
|
|
244
|
+
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
catch (err) {
|