File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,21 @@ except Exception: # pylint: disable=broad-except
125125 print (" Unknown error occurred during Garmin Connect Client get stats" )
126126 quit ()
127127
128+ """
129+ Get steps data
130+ """
131+ try :
132+ print (client.get_steps_data(today.isoformat()))
133+ except (
134+ GarminConnectConnectionError,
135+ GarminConnectAuthenticationError,
136+ GarminConnectTooManyRequestsError,
137+ ) as err:
138+ print (" Error occurred during Garmin Connect Client get heart rates: %s " % err)
139+ quit ()
140+ except Exception : # pylint: disable=broad-except
141+ print (" Unknown error occurred during Garmin Connect Client get steps data" )
142+ quit ()
128143
129144"""
130145Get heart rate data
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ class Garmin(object):
1919 See https://connect.garmin.com/
2020 """
2121 url_user_summary = MODERN_URL + '/proxy/usersummary-service/usersummary/daily/'
22+ url_user_summary_chart = MODERN_URL + '/proxy/wellness-service/wellness/dailySummaryChart/'
2223 url_heartrates = MODERN_URL + '/proxy/wellness-service/wellness/dailyHeartRate/'
2324 url_sleepdata = MODERN_URL + '/proxy/wellness-service/wellness/dailySleepData/'
2425 url_body_composition = MODERN_URL + '/proxy/weight-service/weight/daterangesnapshot'
@@ -240,6 +241,15 @@ def get_sleep_data(self, cdate): # cDate = 'YYYY-mm-dd'
240241
241242 return self .fetch_data (sleepurl )
242243
244+ def get_steps_data (self , cdate ): # cDate = 'YYYY-mm-dd'
245+ """
246+ Fetch available steps data
247+ """
248+ steps_url = self .url_user_summary_chart + self .display_name + '?date=' + cdate
249+ self .logger .debug ("Fetching steps data with url %s" , steps_url )
250+
251+ return self .fetch_data (steps_url )
252+
243253
244254 def get_body_composition (self , cdate ): # cDate = 'YYYY-mm-dd'
245255 """
You can’t perform that action at this time.
0 commit comments