Пример #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
 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))