forked from platypush/platypush
Using modifiedTime instead of startTime to track new data points
This commit is contained in:
parent
c3b2212972
commit
c84a6047ed
1 changed files with 3 additions and 3 deletions
|
@ -73,7 +73,7 @@ class GoogleFitBackend(Backend):
|
||||||
new_data_points = 0
|
new_data_points = 0
|
||||||
|
|
||||||
for dp in data_points:
|
for dp in data_points:
|
||||||
dp_time = dp.pop('startTime', 0)
|
dp_time = dp.pop('modifiedTime', 0)
|
||||||
if 'dataSourceId' in dp:
|
if 'dataSourceId' in dp:
|
||||||
del dp['dataSourceId']
|
del dp['dataSourceId']
|
||||||
|
|
||||||
|
@ -81,9 +81,9 @@ class GoogleFitBackend(Backend):
|
||||||
self.bus.post(GoogleFitEvent(
|
self.bus.post(GoogleFitEvent(
|
||||||
user_id=self.user_id, data_source_id=data_source,
|
user_id=self.user_id, data_source_id=data_source,
|
||||||
data_type=dp.pop('dataTypeName'),
|
data_type=dp.pop('dataTypeName'),
|
||||||
start_time=dp_time,
|
start_time=dp.pop('startTime'),
|
||||||
end_time=dp.pop('endTime'),
|
end_time=dp.pop('endTime'),
|
||||||
modified_time=dp.pop('modifiedTime'),
|
modified_time=dp_time,
|
||||||
values=dp.pop('values'),
|
values=dp.pop('values'),
|
||||||
**{camel_case_to_snake_case(k): v
|
**{camel_case_to_snake_case(k): v
|
||||||
for k, v in dp.items()}
|
for k, v in dp.items()}
|
||||||
|
|
Loading…
Reference in a new issue