tirecheck-device-sdk 0.2.37 → 0.2.38

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
@@ -2811,7 +2811,7 @@ const capabilities$2 = [
2811
2811
  {
2812
2812
  id: "button",
2813
2813
  processFn: processButtonPress$1,
2814
- regex: /^[UDLRC]$/
2814
+ regex: /^\*?[UDLRC]\s?$/
2815
2815
  },
2816
2816
  {
2817
2817
  id: "keepAlive",
@@ -2848,8 +2848,9 @@ function processKeepAlive(deviceId) {
2848
2848
  flexiGaugeCommands.sendKeepAlive(deviceId);
2849
2849
  }
2850
2850
  function processTreadDepth$1(deviceId, value) {
2851
- const treadDepth = value.match(/\d+/)?.[0];
2852
- const convertedValue = Number(treadDepth) / 1e3;
2851
+ const isNewFormat = value.includes("TD");
2852
+ const treadDepth = isNewFormat ? value.match(/\d+/)?.[0] : value.match(/T(\d+\.\d+)m/)?.[1];
2853
+ const convertedValue = Number(treadDepth) / (isNewFormat ? 1e3 : 1);
2853
2854
  simulatorSvc.triggerEvent("fg:treadDepth", deviceId, convertedValue);
2854
2855
  }
2855
2856
  function processButtonPress$1(deviceId, value) {
package/dist/index.mjs CHANGED
@@ -2804,7 +2804,7 @@ const capabilities$2 = [
2804
2804
  {
2805
2805
  id: "button",
2806
2806
  processFn: processButtonPress$1,
2807
- regex: /^[UDLRC]$/
2807
+ regex: /^\*?[UDLRC]\s?$/
2808
2808
  },
2809
2809
  {
2810
2810
  id: "keepAlive",
@@ -2841,8 +2841,9 @@ function processKeepAlive(deviceId) {
2841
2841
  flexiGaugeCommands.sendKeepAlive(deviceId);
2842
2842
  }
2843
2843
  function processTreadDepth$1(deviceId, value) {
2844
- const treadDepth = value.match(/\d+/)?.[0];
2845
- const convertedValue = Number(treadDepth) / 1e3;
2844
+ const isNewFormat = value.includes("TD");
2845
+ const treadDepth = isNewFormat ? value.match(/\d+/)?.[0] : value.match(/T(\d+\.\d+)m/)?.[1];
2846
+ const convertedValue = Number(treadDepth) / (isNewFormat ? 1e3 : 1);
2846
2847
  simulatorSvc.triggerEvent("fg:treadDepth", deviceId, convertedValue);
2847
2848
  }
2848
2849
  function processButtonPress$1(deviceId, value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tirecheck-device-sdk",
3
- "version": "0.2.37",
3
+ "version": "0.2.38",
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",