From c84a6047ed337cd847b1a6494821d4cb6ab88cd4 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 28 Mar 2019 14:17:43 +0100 Subject: [PATCH] Using modifiedTime instead of startTime to track new data points --- platypush/backend/google/fit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platypush/backend/google/fit.py b/platypush/backend/google/fit.py index e8af7bcf9a..7edc74a5cd 100644 --- a/platypush/backend/google/fit.py +++ b/platypush/backend/google/fit.py @@ -73,7 +73,7 @@ class GoogleFitBackend(Backend): new_data_points = 0 for dp in data_points: - dp_time = dp.pop('startTime', 0) + dp_time = dp.pop('modifiedTime', 0) if 'dataSourceId' in dp: del dp['dataSourceId'] @@ -81,9 +81,9 @@ class GoogleFitBackend(Backend): self.bus.post(GoogleFitEvent( user_id=self.user_id, data_source_id=data_source, data_type=dp.pop('dataTypeName'), - start_time=dp_time, + start_time=dp.pop('startTime'), end_time=dp.pop('endTime'), - modified_time=dp.pop('modifiedTime'), + modified_time=dp_time, values=dp.pop('values'), **{camel_case_to_snake_case(k): v for k, v in dp.items()}