tirecheck-device-sdk 0.2.67 → 0.2.68

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
@@ -254,7 +254,7 @@ const bridgeTools = {
254
254
  },
255
255
  convertBarToKpaByte(deviceId, value) {
256
256
  if (!value) return 0;
257
- const bitValue = this.usesKpaPressure(deviceId) ? 1 : 5.0625;
257
+ const bitValue = this.isVersionGreaterThan(deviceId, "1.1.F") ? 1 : 5.0625;
258
258
  return ___default.round((value + 1) * 100 / bitValue);
259
259
  },
260
260
  convertSensorIdForBridge(sensorId) {
@@ -277,7 +277,7 @@ const bridgeTools = {
277
277
  if (!___default.isNumber(value)) {
278
278
  throw new TypeError("Value has to be a number");
279
279
  }
280
- const bitValue = this.usesKpaPressure(deviceId) ? 1 : 5.0625;
280
+ const bitValue = this.isVersionGreaterThan(deviceId, "1.1.F") ? 1 : 5.0625;
281
281
  const rawBar = value * bitValue / 100;
282
282
  return ___default.round(Math.max(rawBar - decrementValue, 0), 1);
283
283
  },
package/dist/index.mjs CHANGED
@@ -247,7 +247,7 @@ const bridgeTools = {
247
247
  },
248
248
  convertBarToKpaByte(deviceId, value) {
249
249
  if (!value) return 0;
250
- const bitValue = this.usesKpaPressure(deviceId) ? 1 : 5.0625;
250
+ const bitValue = this.isVersionGreaterThan(deviceId, "1.1.F") ? 1 : 5.0625;
251
251
  return _.round((value + 1) * 100 / bitValue);
252
252
  },
253
253
  convertSensorIdForBridge(sensorId) {
@@ -270,7 +270,7 @@ const bridgeTools = {
270
270
  if (!_.isNumber(value)) {
271
271
  throw new TypeError("Value has to be a number");
272
272
  }
273
- const bitValue = this.usesKpaPressure(deviceId) ? 1 : 5.0625;
273
+ const bitValue = this.isVersionGreaterThan(deviceId, "1.1.F") ? 1 : 5.0625;
274
274
  const rawBar = value * bitValue / 100;
275
275
  return _.round(Math.max(rawBar - decrementValue, 0), 1);
276
276
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tirecheck-device-sdk",
3
- "version": "0.2.67",
3
+ "version": "0.2.68",
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",