incyclist-devices 2.2.2 → 2.2.3

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.
@@ -20,7 +20,7 @@ export default class AntFEAdapter extends AntAdapter<FitnessEquipmentSensorState
20
20
  constructor(settings: AntDeviceSettings, props?: AntDeviceProperties);
21
21
  getDisplayName(): string;
22
22
  isReconnecting(): boolean;
23
- sendUpdate(request: UpdateRequest, forced?: boolean): Promise<UpdateRequest | void>;
23
+ sendUpdate(request: UpdateRequest): Promise<UpdateRequest | void>;
24
24
  onDeviceData(deviceData: FitnessEquipmentSensorState): void;
25
25
  mapData(deviceData: FitnessEquipmentSensorState): IncyclistBikeData;
26
26
  transformData(adapterData: IncyclistBikeData, deviceData: FitnessEquipmentSensorState): void;
@@ -36,9 +36,9 @@ class AntFEAdapter extends adapter_1.default {
36
36
  isReconnecting() {
37
37
  return this.promiseReconnect !== null && this.promiseReconnect !== undefined;
38
38
  }
39
- sendUpdate(request, forced = false) {
39
+ sendUpdate(request) {
40
40
  return __awaiter(this, void 0, void 0, function* () {
41
- if ((this.paused || this.isReconnecting()) && !forced)
41
+ if ((this.paused || this.isReconnecting()) && !request.forced)
42
42
  return;
43
43
  if (this.promiseStop)
44
44
  return;
@@ -269,7 +269,7 @@ class AntFEAdapter extends adapter_1.default {
269
269
  if (this.getCyclingMode() instanceof antble_erg_1.default) {
270
270
  const power = this.data.power;
271
271
  const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
272
- yield this.sendUpdate(request, true);
272
+ yield this.sendUpdate(Object.assign(Object.assign({}, request), { forced: true }));
273
273
  return true;
274
274
  }
275
275
  }
@@ -59,7 +59,7 @@ class AntPwrAdapter extends adapter_1.default {
59
59
  sendUpdate(request) {
60
60
  return __awaiter(this, void 0, void 0, function* () {
61
61
  try {
62
- if (this.isPaused() || this.isStopped())
62
+ if ((this.isPaused() || this.isStopped()) && !request.forced)
63
63
  return;
64
64
  return yield this.getCyclingMode().sendBikeUpdate(request);
65
65
  }
@@ -197,7 +197,7 @@ class IncyclistDevice extends events_1.default {
197
197
  return __awaiter(this, void 0, void 0, function* () {
198
198
  if (!this.isControllable())
199
199
  return;
200
- if (this.isPaused() || this.isStopped())
200
+ if (!request.enforced && (this.isPaused() || this.isStopped()))
201
201
  return;
202
202
  if (!this.hasCapability(types_1.IncyclistCapability.Control))
203
203
  return yield this.getCyclingMode().sendBikeUpdate(request);
@@ -9,6 +9,7 @@ export type UpdateRequest = {
9
9
  refresh?: boolean;
10
10
  init?: boolean;
11
11
  gear?: number;
12
+ forced?: boolean;
12
13
  };
13
14
  export declare enum CyclingModeProperyType {
14
15
  Integer = "Integer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "dependencies": {
5
5
  "@serialport/bindings-interface": "^1.2.2",
6
6
  "@serialport/parser-byte-length": "^9.0.1",