예제 #1
0
 def get_sleep_stats(cls, db, start_ts, end_ts):
     """Return a dictionary of aggregate sleep statistics for the given time period."""
     return {
         'sleep_avg' : conversions.secs_to_dt_time(cls.get_col_avg(db, cls.sleep_secs, start_ts, end_ts, True)),
         'sleep_min' : conversions.secs_to_dt_time(cls.get_col_min(db, cls.sleep_secs, start_ts, end_ts, True)),
         'sleep_max' : conversions.secs_to_dt_time(cls.get_col_max(db, cls.sleep_secs, start_ts, end_ts)),
     }
예제 #2
0
 def get_sleep_stats(cls, db, start_ts, end_ts):
     return {
         'sleep_avg':
         conversions.secs_to_dt_time(
             cls.get_col_avg(db, cls.sleep_secs, start_ts, end_ts, True)),
         'sleep_min':
         conversions.secs_to_dt_time(
             cls.get_col_min(db, cls.sleep_secs, start_ts, end_ts, True)),
         'sleep_max':
         conversions.secs_to_dt_time(
             cls.get_col_max(db, cls.sleep_secs, start_ts, end_ts)),
     }
예제 #3
0
파일: fields.py 프로젝트: wmbaum/Fit
 def _convert_single(self, seconds, invalid):
     if seconds != invalid:
         return conversions.secs_to_dt_time(seconds)
예제 #4
0
 def get_lap_duration(self, lap):
     """Return the recorded duration for the lap."""
     return conversions.secs_to_dt_time(super().get_lap_duration(lap))