Skip to content

Count only asleep time in daily Health export summaries #38

Closed

Description

@johnnyhuy

Part of #6.

DailyHealthSummary currently sums every sleep-analysis interval, so in-bed and awake records inflate sleep duration and overlapping stage or device records are counted twice.

Complete one core-only slice:

  • Count recognised asleep categories, including legacy asleep and current sleep stages.
  • Exclude awake, in-bed, unknown categories and invalid or incomplete intervals.
  • Merge overlapping asleep intervals within each existing start-date calendar-day bucket.
  • Cover the XML parser to daily summary to CSV/JSON path with tests, preserving nil when no valid asleep interval is present.

Keep the existing start-date day allocation. Cross-midnight splitting, source prioritisation and UI are outside this slice.

Activity

  1. johnnyhuy commented on Nov 10, 2026

    @johnnyhuy
    ContributorAuthor

    agent claim: agent/issue-38-sleep-duration @ be32d20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentclaimed by the BetterFit work loop

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions