From 364d11f1a7ef64cfac99ab8304f7d842940c3bae Mon Sep 17 00:00:00 2001 From: jlestel Date: Thu, 19 Sep 2024 15:20:19 +0200 Subject: [PATCH] fix: don't send offline events --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index eb77143..77949ea 100644 --- a/index.js +++ b/index.js @@ -187,7 +187,7 @@ function transformMessage(data) { associativeArray["Latitude"], // est_lat associativeArray["Longitude"], // est_lng power, // power - associativeArray["Gear"] ?? "P", // shift_state + associativeArray["Gear"] ?? "", // shift_state associativeArray["RatedRange"], // range associativeArray["EstBatteryRange"], // est_range associativeArray["GpsHeading"] ?? "", // heading @@ -214,7 +214,7 @@ function transformMessage(data) { r.value = r.value.replace("ELEVATION", ""); }*/ - if (associativeArray["Latitude"] && associativeArray["Longitude"]) { + if (associativeArray["Latitude"] && associativeArray["Longitude"] && associativeArray["Gear"] && associativeArray["Gear"] != "") { return r; } else { //console.error("no gps data");