fix(resmed): resolve 4 SleepLab validation bugs (closes #28)

Summary

  • Bug 1 (BLOCKER — timestamps): timestamps and timestamps_low in TimeSeriesData are now absolute UTC Unix epoch seconds. All three signal-parsing methods (_parse_brp_signals, _parse_pld_signals, _parse_generic_signals) accept session_start: datetime and offset each sample by session_start.timestamp(). Breaking change; consuming apps no longer need to add session.start_time.timestamp() manually.
  • Bug 2 (duration accuracy): usage_hours in daily_summaries is patched from summed EDF session durations per day, matching what OSCAR reads from the PLD/BRP headers.
  • Bug 3 (serial "Unknown"): Added _read_identification_json_directly fallback that walks three known AirSense 10/11 JSON nesting paths when cpap-py's IdentificationParser returns None.
  • Bug 4 (ghost sessions): daily_summaries is filtered to only dates that have at least one session in DATALOG, removing the ~320 historical STR.edf entries with no EDF data.

Test plan

  • uv run pytest tests/ -v -k "not resmed_adapter" — unit tests pass (pyedflib optional)
  • uv run pytest validation/ --run-validation -v — ResMed cam/hanna validation pass rate ≥ 0.95
  • Manually confirm sessions[0].timeseries.timestamps[0] > 1e9 on a real ResMed parse (absolute UTC, not 0.0)
  • Confirm serial is non-"Unknown" for AirSense 10/11

🤖 Generated with Claude Code

Merge request reports

Loading