Skip to content

Commit

Permalink
Added reload_data API call
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberjunky committed Nov 21, 2023
1 parent 9abdb6f commit 6adfb76
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 35 deletions.
70 changes: 35 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,28 @@ $ ./example.py
*** Garmin Connect API Demo by cyberjunky ***
Trying to login to Garmin Connect using token data from '~/.garminconnect'...
1 -- Get full name
2 -- Get unit system
3 -- Get activity data for '2023-10-28'
4 -- Get activity data for '2023-10-28' (compatible with garminconnect-ha)
5 -- Get body composition data for '2023-10-28' (compatible with garminconnect-ha)
6 -- Get body composition data for from '2023-10-21' to '2023-10-28' (to be compatible with garminconnect-ha)
7 -- Get stats and body composition data for '2023-10-28'
8 -- Get steps data for '2023-10-28'
9 -- Get heart rate data for '2023-10-28'
0 -- Get training readiness data for '2023-10-28'
- -- Get daily step data for '2023-10-21' to '2023-10-28'
/ -- Get body battery data for '2023-10-21' to '2023-10-28'
! -- Get floors data for '2023-10-21'
? -- Get blood pressure data for '2023-10-21' to '2023-10-28'
. -- Get training status data for '2023-10-28'
a -- Get resting heart rate data for 2023-10-28'
b -- Get hydration data for '2023-10-28'
c -- Get sleep data for '2023-10-28'
d -- Get stress data for '2023-10-28'
e -- Get respiration data for '2023-10-28'
f -- Get SpO2 data for '2023-10-28'
g -- Get max metric data (like vo2MaxValue and fitnessAge) for '2023-10-28'
3 -- Get activity data for '2023-11-21'
4 -- Get activity data for '2023-11-21' (compatible with garminconnect-ha)
5 -- Get body composition data for '2023-11-21' (compatible with garminconnect-ha)
6 -- Get body composition data for from '2023-11-14' to '2023-11-21' (to be compatible with garminconnect-ha)
7 -- Get stats and body composition data for '2023-11-21'
8 -- Get steps data for '2023-11-21'
9 -- Get heart rate data for '2023-11-21'
0 -- Get training readiness data for '2023-11-21'
- -- Get daily step data for '2023-11-14' to '2023-11-21'
/ -- Get body battery data for '2023-11-14' to '2023-11-21'
! -- Get floors data for '2023-11-14'
? -- Get blood pressure data for '2023-11-14' to '2023-11-21'
. -- Get training status data for '2023-11-21'
a -- Get resting heart rate data for 2023-11-21'
b -- Get hydration data for '2023-11-21'
c -- Get sleep data for '2023-11-21'
d -- Get stress data for '2023-11-21'
e -- Get respiration data for '2023-11-21'
f -- Get SpO2 data for '2023-11-21'
g -- Get max metric data (like vo2MaxValue and fitnessAge) for '2023-11-21'
h -- Get personal record for user
i -- Get earned badges for user
j -- Get adhoc challenges data from start '0' and limit '100'
Expand All @@ -37,32 +35,34 @@ l -- Get badge challenges data from '1' and limit '100'
m -- Get non completed badge challenges data from '1' and limit '100'
n -- Get activities data from start '0' and limit '100'
o -- Get last activity
p -- Download activities data by date from '2023-10-21' to '2023-10-28'
p -- Download activities data by date from '2023-11-14' to '2023-11-21'
r -- Get all kinds of activities data from '0'
s -- Upload activity data from file 'MY_ACTIVITY.fit'
t -- Get all kinds of Garmin device info
u -- Get active goals
v -- Get future goals
w -- Get past goals
y -- Get all Garmin device alarms
x -- Get Heart Rate Variability data (HRV) for '2023-10-28'
z -- Get progress summary from '2023-10-21' to '2023-10-28' for all metrics
x -- Get Heart Rate Variability data (HRV) for '2023-11-21'
z -- Get progress summary from '2023-11-14' to '2023-11-21' for all metrics
A -- Get gear, the defaults, activity types and statistics
B -- Get weight-ins from '2023-10-21' to '2023-10-28'
C -- Get daily weigh-ins for '2023-10-28'
D -- Delete all weigh-ins for '2023-10-28'
E -- Add a weigh-in of 89.6kg on '2023-10-28'
F -- Get virtual challenges/expeditions from '2023-10-21' to '2023-10-28'
G -- Get hill score data from '2023-10-21' to '2023-10-28'
H -- Get endurance score data from '2023-10-21' to '2023-10-28'
I -- Get activities for date '2023-10-28'
B -- Get weight-ins from '2023-11-14' to '2023-11-21'
C -- Get daily weigh-ins for '2023-11-21'
D -- Delete all weigh-ins for '2023-11-21'
E -- Add a weigh-in of 89.6kg on '2023-11-21'
F -- Get virtual challenges/expeditions from '2023-11-14' to '2023-11-21'
G -- Get hill score data from '2023-11-14' to '2023-11-21'
H -- Get endurance score data from '2023-11-14' to '2023-11-21'
I -- Get activities for date '2023-11-21'
J -- Get race predictions
K -- Get all day stress data for '2023-10-28'
L -- Add body composition for '2023-10-28'
K -- Get all day stress data for '2023-11-21'
L -- Add body composition for '2023-11-21'
M -- Set blood pressure '120,80,80,notes='Testing with example.py'
N -- Get user profile/settings
O -- Reload epoch data for 2023-11-21
Z -- Remove stored login tokens (logout)
q -- Exit
Make your selection:
```

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/cyberjunkynl/)
Expand Down
7 changes: 7 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"L": f"Add body composition for '{today.isoformat()}'",
"M": "Set blood pressure '120,80,80,notes='Testing with example.py'",
"N": "Get user profile/settings",
"O": f"Reload epoch data for {today.isoformat()}",
"Z": "Remove stored login tokens (logout)",
"q": "Exit",
}
Expand Down Expand Up @@ -677,6 +678,12 @@ def switch(api, i):
"api.get_user_profile()",
api.get_user_profile()
)
elif i == "O":
# Reload epoch data for date
display_json(
f"api.request_reload({today.isoformat()})",
api.request_reload(today.isoformat())
)
elif i == "Z":
# Remove stored login tokens for Garmin Connect portal
tokendir = os.path.expanduser(tokenstore)
Expand Down

0 comments on commit 6adfb76

Please sign in to comment.