tirecheck-device-sdk 0.1.991 → 0.1.993

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/dist/index.cjs CHANGED
@@ -2087,7 +2087,7 @@ const bridgeCommands = {
2087
2087
  return clearTimeout(keepAliveTimer[device.id]);
2088
2088
  }
2089
2089
  this.sendKeepAliveCommand(device);
2090
- }, 1e4);
2090
+ }, 8e3);
2091
2091
  return promiseQueue.enqueue(device, writeCommand);
2092
2092
  }
2093
2093
  };
@@ -2341,9 +2341,10 @@ async function setAxleInfo(deviceId, tcVehicle) {
2341
2341
  if (spareTyre && spareTyre.tcTpmsSensor?.id) {
2342
2342
  tyres[7] = bridgeTools.convertSensorIdForBridge(spareTyre.tcTpmsSensor?.id);
2343
2343
  }
2344
- const axleTyres = tcVehicle.tcTyres?.filter(
2344
+ let axleTyres = tcVehicle.tcTyres?.filter(
2345
2345
  (t) => t.mountedOn?.positionId ? bridgeTools.getPositionInfo(t.mountedOn?.positionId).axlePosition === axleIndex + 1 && spareTyre?.mountedOn?.positionId !== t.mountedOn?.positionId : false
2346
2346
  ) || [];
2347
+ axleTyres = axleTyres.sort((a, b) => (a.mountedOn?.positionId || 0) - (b.mountedOn?.positionId || 0));
2347
2348
  for (let tyreIndex = 0; tyreIndex < axleTyres.length; tyreIndex++) {
2348
2349
  const sensorId = axleTyres[tyreIndex].tcTpmsSensor?.id;
2349
2350
  if (!sensorId) continue;
package/dist/index.mjs CHANGED
@@ -2080,7 +2080,7 @@ const bridgeCommands = {
2080
2080
  return clearTimeout(keepAliveTimer[device.id]);
2081
2081
  }
2082
2082
  this.sendKeepAliveCommand(device);
2083
- }, 1e4);
2083
+ }, 8e3);
2084
2084
  return promiseQueue.enqueue(device, writeCommand);
2085
2085
  }
2086
2086
  };
@@ -2334,9 +2334,10 @@ async function setAxleInfo(deviceId, tcVehicle) {
2334
2334
  if (spareTyre && spareTyre.tcTpmsSensor?.id) {
2335
2335
  tyres[7] = bridgeTools.convertSensorIdForBridge(spareTyre.tcTpmsSensor?.id);
2336
2336
  }
2337
- const axleTyres = tcVehicle.tcTyres?.filter(
2337
+ let axleTyres = tcVehicle.tcTyres?.filter(
2338
2338
  (t) => t.mountedOn?.positionId ? bridgeTools.getPositionInfo(t.mountedOn?.positionId).axlePosition === axleIndex + 1 && spareTyre?.mountedOn?.positionId !== t.mountedOn?.positionId : false
2339
2339
  ) || [];
2340
+ axleTyres = axleTyres.sort((a, b) => (a.mountedOn?.positionId || 0) - (b.mountedOn?.positionId || 0));
2340
2341
  for (let tyreIndex = 0; tyreIndex < axleTyres.length; tyreIndex++) {
2341
2342
  const sensorId = axleTyres[tyreIndex].tcTpmsSensor?.id;
2342
2343
  if (!sensorId) continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tirecheck-device-sdk",
3
- "version": "0.1.991",
3
+ "version": "0.1.993",
4
4
  "description": "SDK for working with various devices produced by Tirecheck via Bluetooth (CAN Bridge, Routers, Sensors, FlexiGauge, PressureStick, etc)",
5
5
  "author": "Leonid Buneev <leonid.buneev@tirecheck.com>",
6
6
  "license": "ISC",