tirecheck-device-sdk 0.2.42 → 0.2.43
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 +8 -6
- package/dist/index.mjs +8 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2302,16 +2302,18 @@ async function setAxleInfo(deviceId, tcVehicle) {
|
|
|
2302
2302
|
(t) => t.mountedOn?.positionId ? bridgeTools.getPositionInfo(t.mountedOn?.positionId).axlePosition === axleIndex + 1 && spareTyre?.mountedOn?.positionId !== t.mountedOn?.positionId : false
|
|
2303
2303
|
) || [];
|
|
2304
2304
|
axleTyres = axleTyres.sort((a, b) => (a.mountedOn?.positionId || 0) - (b.mountedOn?.positionId || 0));
|
|
2305
|
-
for (
|
|
2306
|
-
const
|
|
2305
|
+
for (const [tyreIndex, tyre] of axleTyres.entries()) {
|
|
2306
|
+
const tyrePosition = tyre.mountedOn && bridgeTools.getPositionInfo(tyre.mountedOn.positionId).tyrePosition;
|
|
2307
|
+
const realTyreIndex = tyrePosition ? tyrePosition - 1 : tyreIndex;
|
|
2308
|
+
const sensorId = tyre.tcTpmsSensor?.id;
|
|
2307
2309
|
if (!sensorId) continue;
|
|
2308
2310
|
if (axle.isSpare) continue;
|
|
2309
2311
|
const isTwinTyre = axle.tyresCount === 4;
|
|
2310
2312
|
let bridgeTyreIndex = 0;
|
|
2311
|
-
if (isTwinTyre &&
|
|
2312
|
-
if (isTwinTyre &&
|
|
2313
|
-
if (isTwinTyre &&
|
|
2314
|
-
if (isTwinTyre &&
|
|
2313
|
+
if (isTwinTyre && realTyreIndex === 0) bridgeTyreIndex = 5;
|
|
2314
|
+
if (isTwinTyre && realTyreIndex === 1 || !isTwinTyre && realTyreIndex === 0) bridgeTyreIndex = 6;
|
|
2315
|
+
if (isTwinTyre && realTyreIndex === 3) bridgeTyreIndex = 9;
|
|
2316
|
+
if (isTwinTyre && realTyreIndex === 2 || !isTwinTyre && realTyreIndex === 1) bridgeTyreIndex = 8;
|
|
2315
2317
|
tyres[bridgeTyreIndex] = bridgeTools.convertSensorIdForBridge(sensorId);
|
|
2316
2318
|
}
|
|
2317
2319
|
if (!___default.inRange(axleIndex, 0, 16)) return;
|
package/dist/index.mjs
CHANGED
|
@@ -2295,16 +2295,18 @@ async function setAxleInfo(deviceId, tcVehicle) {
|
|
|
2295
2295
|
(t) => t.mountedOn?.positionId ? bridgeTools.getPositionInfo(t.mountedOn?.positionId).axlePosition === axleIndex + 1 && spareTyre?.mountedOn?.positionId !== t.mountedOn?.positionId : false
|
|
2296
2296
|
) || [];
|
|
2297
2297
|
axleTyres = axleTyres.sort((a, b) => (a.mountedOn?.positionId || 0) - (b.mountedOn?.positionId || 0));
|
|
2298
|
-
for (
|
|
2299
|
-
const
|
|
2298
|
+
for (const [tyreIndex, tyre] of axleTyres.entries()) {
|
|
2299
|
+
const tyrePosition = tyre.mountedOn && bridgeTools.getPositionInfo(tyre.mountedOn.positionId).tyrePosition;
|
|
2300
|
+
const realTyreIndex = tyrePosition ? tyrePosition - 1 : tyreIndex;
|
|
2301
|
+
const sensorId = tyre.tcTpmsSensor?.id;
|
|
2300
2302
|
if (!sensorId) continue;
|
|
2301
2303
|
if (axle.isSpare) continue;
|
|
2302
2304
|
const isTwinTyre = axle.tyresCount === 4;
|
|
2303
2305
|
let bridgeTyreIndex = 0;
|
|
2304
|
-
if (isTwinTyre &&
|
|
2305
|
-
if (isTwinTyre &&
|
|
2306
|
-
if (isTwinTyre &&
|
|
2307
|
-
if (isTwinTyre &&
|
|
2306
|
+
if (isTwinTyre && realTyreIndex === 0) bridgeTyreIndex = 5;
|
|
2307
|
+
if (isTwinTyre && realTyreIndex === 1 || !isTwinTyre && realTyreIndex === 0) bridgeTyreIndex = 6;
|
|
2308
|
+
if (isTwinTyre && realTyreIndex === 3) bridgeTyreIndex = 9;
|
|
2309
|
+
if (isTwinTyre && realTyreIndex === 2 || !isTwinTyre && realTyreIndex === 1) bridgeTyreIndex = 8;
|
|
2308
2310
|
tyres[bridgeTyreIndex] = bridgeTools.convertSensorIdForBridge(sensorId);
|
|
2309
2311
|
}
|
|
2310
2312
|
if (!_.inRange(axleIndex, 0, 16)) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tirecheck-device-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.43",
|
|
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",
|