sirfoga / pygce

:snake: A tool to export, save, and analyze your Garmin Connect data

Home Page:https://pypi.python.org/pypi/pygce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Garmin step details output off by varying amounts

sirfoga opened this issue · comments

commented

Expected Behavior

Garmin step details output for the day

Actual Behavior

However, the 15 min bin counts are off by varying amounts. When comparing the pygce json generated 15 min counts against what is displayed on the Garmin step details screen, I see that the generated json files are always missing the last 4 or 5 hours of data.

The 15 min bin output for day 2018-05-10:

{"15-min bins": [{"time": "2018-05-10 04:00:00", "steps": 0}, {"time": "2018-05-10 04:15:00", "steps": 0}, . . .etc etc etc}

Steps to Reproduce the Problem

  1. login
  2. view step details for a day

Specifications

  • pygce version (check pip3 show pygce): 2.0.6
  • Platform (e.g Windows 8, Mac OSX Sierra, Ubuntu 18.04 ...): Ubuntu 18.04
  • Url of connection (e.g https://connect.garmin.com, if you don't know it,
    then it's the stock one: https://connect.garmin.com):
  • Python version (check python --version): 3.6.7
commented

It turns out that the python script starts recording 15 min bin data 4 or 5 hours later than time 00:00:00. This results in the first data point receiving an index of 4am or 5am. By the time it reaches 12:00am the 15 min data collection stops and moves on to the next day starting with a 4 or 5 hour offset. After some pondering it occurred to me that the dates are off by GMT and daylight savings time in the United States.

commented

In addition to this, the function that retrieves the step details for the day, now retrieves them also for the day before and the day after (when possible): it is left to the final user to make the right adjustments GMT -> whatever-timezone-you're-in