fix(resmed): resolve 4 SleepLab validation bugs (closes #28)
Summary
- Bug 1 (BLOCKER — timestamps):
timestampsandtimestamps_lowinTimeSeriesDataare now absolute UTC Unix epoch seconds. All three signal-parsing methods (_parse_brp_signals,_parse_pld_signals,_parse_generic_signals) acceptsession_start: datetimeand offset each sample bysession_start.timestamp(). Breaking change; consuming apps no longer need to addsession.start_time.timestamp()manually. - Bug 2 (duration accuracy):
usage_hoursindaily_summariesis 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_directlyfallback that walks three known AirSense 10/11 JSON nesting paths when cpap-py'sIdentificationParserreturnsNone. - Bug 4 (ghost sessions):
daily_summariesis 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] > 1e9on a real ResMed parse (absolute UTC, not 0.0) - Confirm serial is non-"Unknown" for AirSense 10/11