tirecheck-device-sdk 0.2.63 → 0.2.64

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
@@ -2492,7 +2492,7 @@ async function getSensorReading(deviceId, positionId) {
2492
2492
  sensorStatus: payload[3],
2493
2493
  eceStatus: payload[4],
2494
2494
  pressureIssue: getPressureIssue$1(deviceId, payload[4]),
2495
- ...getPressureAndTemperatureReadingObjects(payload[0], payload[1]),
2495
+ ...getPressureAndTemperatureReadingObjects(payload[0], payload[1], payload[6]),
2496
2496
  byteReading: value
2497
2497
  };
2498
2498
  }
@@ -2573,16 +2573,17 @@ async function resetAutolearnStatuses(deviceId, positionIds) {
2573
2573
  }
2574
2574
  await bridgeCommands.setAutolearnIdStatus(deviceId, statuses);
2575
2575
  }
2576
- function getPressureAndTemperatureReadingObjects(rawPressure, rawTemperature) {
2576
+ function getPressureAndTemperatureReadingObjects(rawPressure, rawTemperature, sensorType) {
2577
2577
  if (rawTemperature === 255 || rawPressure === 0) {
2578
2578
  return {
2579
2579
  pressure: void 0,
2580
2580
  temperature: void 0
2581
2581
  };
2582
2582
  }
2583
+ const bitValue = sensorType === 1 ? 6.7 : 5.0625;
2583
2584
  const ambientTemperature = 20;
2584
2585
  const measuredTemperature = rawTemperature - 40;
2585
- const measuredPressureAbsolute = rawPressure / 19.753086;
2586
+ const measuredPressureAbsolute = rawPressure * (bitValue / 100);
2586
2587
  const compensatedPressureAbsolute = measuredPressureAbsolute * (273 + ambientTemperature) / (273 + measuredTemperature);
2587
2588
  return {
2588
2589
  pressure: {
package/dist/index.mjs CHANGED
@@ -2485,7 +2485,7 @@ async function getSensorReading(deviceId, positionId) {
2485
2485
  sensorStatus: payload[3],
2486
2486
  eceStatus: payload[4],
2487
2487
  pressureIssue: getPressureIssue$1(deviceId, payload[4]),
2488
- ...getPressureAndTemperatureReadingObjects(payload[0], payload[1]),
2488
+ ...getPressureAndTemperatureReadingObjects(payload[0], payload[1], payload[6]),
2489
2489
  byteReading: value
2490
2490
  };
2491
2491
  }
@@ -2566,16 +2566,17 @@ async function resetAutolearnStatuses(deviceId, positionIds) {
2566
2566
  }
2567
2567
  await bridgeCommands.setAutolearnIdStatus(deviceId, statuses);
2568
2568
  }
2569
- function getPressureAndTemperatureReadingObjects(rawPressure, rawTemperature) {
2569
+ function getPressureAndTemperatureReadingObjects(rawPressure, rawTemperature, sensorType) {
2570
2570
  if (rawTemperature === 255 || rawPressure === 0) {
2571
2571
  return {
2572
2572
  pressure: void 0,
2573
2573
  temperature: void 0
2574
2574
  };
2575
2575
  }
2576
+ const bitValue = sensorType === 1 ? 6.7 : 5.0625;
2576
2577
  const ambientTemperature = 20;
2577
2578
  const measuredTemperature = rawTemperature - 40;
2578
- const measuredPressureAbsolute = rawPressure / 19.753086;
2579
+ const measuredPressureAbsolute = rawPressure * (bitValue / 100);
2579
2580
  const compensatedPressureAbsolute = measuredPressureAbsolute * (273 + ambientTemperature) / (273 + measuredTemperature);
2580
2581
  return {
2581
2582
  pressure: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tirecheck-device-sdk",
3
- "version": "0.2.63",
3
+ "version": "0.2.64",
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",