Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
don't send telemetry if it is invalid (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBrucksch authored Mar 31, 2021
1 parent 3dc4257 commit 7fb42eb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ public void run() {
try {
sLog.debug("AbrpUpdater, updating telemetry object");
mJTlmObj.put(ABETTERROUTEPLANNER_JSON_TIME, System.currentTimeMillis() / 1000);
mJTlmObj.put(ABETTERROUTEPLANNER_JSON_SOC, mGreenCarManager.getBatteryChargePersent());
int soc = mGreenCarManager.getBatteryChargePersent();
if (soc == 0) return;
mJTlmObj.put(ABETTERROUTEPLANNER_JSON_SOC, soc);
mJTlmObj.put(ABETTERROUTEPLANNER_JSON_SPEED, mCarInfoManager.getCarSpeed());
mJTlmObj.put(ABETTERROUTEPLANNER_JSON_CHARGING, mGreenCarManager.getChargeStatus());
mJTlmObj.put(ABETTERROUTEPLANNER_JSON_POWER, mAverageCollector.getAverage());
Expand Down

0 comments on commit 7fb42eb

Please sign in to comment.