Ejemplo n.º 1
0
 def __get_weight_day(self, directory, day, overwite=False):
     root_logger.info("Checking weight: %s overwite %r", day, overwite)
     date_str = day.strftime('%Y-%m-%d')
     params = {
         'startDate' : date_str,
         'endDate'   : date_str,
         '_'         : str(conversions.dt_to_epoch_ms(conversions.date_to_dt(day)))
     }
     return self.rest_client.download_json_file(self.garmin_connect_weight_url, params, directory + '/weight_' + date_str, overwite)
Ejemplo n.º 2
0
 def __get_summary_day(self, directory, date, overwite=False):
     root_logger.info("get_summary_day: %s", date)
     date_str = date.strftime('%Y-%m-%d')
     params = {
         'calendarDate' : date_str,
         '_'         : str(conversions.dt_to_epoch_ms(conversions.date_to_dt(date)))
     }
     url = self.garmin_connect_daily_summary_url + self.display_name
     return self.rest_client.download_json_file(url, params, directory + '/daily_summary_' + date_str, overwite)
Ejemplo n.º 3
0
 def __get_weight_day(self, directory, day, overwite=False):
     root_logger.info("Checking weight: %s overwite %r", day, overwite)
     date_str = day.strftime('%Y-%m-%d')
     params = {
         'startDate' : date_str,
         'endDate'   : date_str,
         '_'         : str(conversions.dt_to_epoch_ms(conversions.date_to_dt(day)))
     }
     json_filename = f'{directory}/weight_{date_str}'
     try:
         self.modern_rest_client.download_json_file(self.garmin_connect_weight_url, json_filename, overwite, params)
     except RestException as e:
         root_logger.error("Exception geting daily summary: %s", e)
Ejemplo n.º 4
0
 def __get_summary_day(self, directory_func, date, overwite=False):
     root_logger.info("get_summary_day: %s", date)
     date_str = date.strftime('%Y-%m-%d')
     params = {
         'calendarDate' : date_str,
         '_'         : str(conversions.dt_to_epoch_ms(conversions.date_to_dt(date)))
     }
     url = f'{self.garmin_connect_daily_summary_url}/{self.display_name}'
     json_filename = f'{directory_func(date.year)}/daily_summary_{date_str}'
     try:
         self.modern_rest_client.download_json_file(url, json_filename, overwite, params)
     except RestException as e:
         root_logger.error("Exception geting daily summary: %s", e)