Skip to content

Commit

Permalink
fix: don't send offline events
Browse files Browse the repository at this point in the history
  • Loading branch information
jlestel authored Sep 19, 2024
1 parent 58b5b4a commit 364d11f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
Expand Down

0 comments on commit 364d11f

Please # to comment.