From c6ddfa25b2e16321a464be224991c0b1b681b4b8 Mon Sep 17 00:00:00 2001 From: peter-quandify Date: Fri, 15 Nov 2024 19:24:52 +0100 Subject: [PATCH] Removed unused functions crashing the decoder (#841) * Removed unused functions crashing the decoder * Updated product description --- vendor/quandify/cubicmeter-1-1-copper.yaml | 2 +- vendor/quandify/cubicmeter-1-1-plastic.yaml | 2 +- vendor/quandify/cubicmeter-1-1-uplink.js | 20 -------------------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/vendor/quandify/cubicmeter-1-1-copper.yaml b/vendor/quandify/cubicmeter-1-1-copper.yaml index 24b9516490..be0a90a163 100644 --- a/vendor/quandify/cubicmeter-1-1-copper.yaml +++ b/vendor/quandify/cubicmeter-1-1-copper.yaml @@ -1,5 +1,5 @@ name: CubicMeter 1.1 Copper -description: Non-invasive water meter and leakage sensor +description: Clamp-on water flow meter and leak sensor. # Hardware versions (optional) hardwareVersions: diff --git a/vendor/quandify/cubicmeter-1-1-plastic.yaml b/vendor/quandify/cubicmeter-1-1-plastic.yaml index a0df8a9642..e4798b51bc 100644 --- a/vendor/quandify/cubicmeter-1-1-plastic.yaml +++ b/vendor/quandify/cubicmeter-1-1-plastic.yaml @@ -1,5 +1,5 @@ name: CubicMeter 1.1 Plastic -description: Non-invasive water meter and leakage sensor +description: Clamp-on water flow meter and leak sensor. # Hardware versions (optional) hardwareVersions: diff --git a/vendor/quandify/cubicmeter-1-1-uplink.js b/vendor/quandify/cubicmeter-1-1-uplink.js index cf32182440..6e0f03f1b0 100644 --- a/vendor/quandify/cubicmeter-1-1-uplink.js +++ b/vendor/quandify/cubicmeter-1-1-uplink.js @@ -277,26 +277,6 @@ var normalizeUplink = function (input) { }; }; -// Convert a hex string to decimal array -var hexToDecArray = function (hexString) { - const size = 2; - const length = Math.ceil(hexString.length / size); - const decimalList = new Array(length); - - for (let i = 0, o = 0; i < length; ++i, o += size) { - decimalList[i] = parseInt(hexString.substr(o, size), 16); - } - - return decimalList; -}; - -var base64ToDecArray = function (base64String) { - const buffer = Buffer.from(base64String, 'base64'); - const bufString = buffer.toString('hex'); - - return hexToDecArray(bufString); -}; - var decArrayToStr = function (byteArray) { return Array.from(byteArray, function (byte) { return ('0' + (byte & 0xff).toString(16)).slice(-2).toUpperCase();