Previously, not all the sleep stages that are supported in HealthKit and Health Connect were supported in the Health package. On the iOS side, some of the sleep stages were supported but undocumented. This PR improves support and documentation for all possible sleep stages across both platforms:
SLEEP_CORE was renamed to SLEEP_LIGHT to be consistent with Android, as HealthKit documentation states that the asleepCore stage includes "light sleep".
Introduce new Health Connect sleep stage that was previously unsupported: SLEEP_UNKNOWN and SLEEP_AWAKE_IN_BED.
Remove undocumented HealthKit sleep stages: SLEEP_ASLEEP_CORE, SLEEP_ASLEEP_DEEP, SLEEP_ASLEEP_REM and combine them into the previously existing Android stages: SLEEP_DEEP, SLEEP_REM (and as previously mentioned SLEEP_ASLEEP_CORE becomes SLEEP_LIGHT.
SLEEP_ASLEEP on iOS previously referred to asleepCore, which is incorrect - it should refer to when the user is asleep but the sleep stage cannot be determined, and as such it now refers to asleepUnspecified.
Previously, not all the sleep stages that are supported in HealthKit and Health Connect were supported in the Health package. On the iOS side, some of the sleep stages were supported but undocumented. This PR improves support and documentation for all possible sleep stages across both platforms:
Closes #985.
Overview of the changes
SLEEP_CORE
was renamed toSLEEP_LIGHT
to be consistent with Android, as HealthKit documentation states that theasleepCore
stage includes "light sleep".SLEEP_UNKNOWN
andSLEEP_AWAKE_IN_BED
.SLEEP_ASLEEP_CORE
,SLEEP_ASLEEP_DEEP
,SLEEP_ASLEEP_REM
and combine them into the previously existing Android stages:SLEEP_DEEP
,SLEEP_REM
(and as previously mentionedSLEEP_ASLEEP_CORE
becomesSLEEP_LIGHT
.SLEEP_ASLEEP
on iOS previously referred toasleepCore
, which is incorrect - it should refer to when the user is asleep but the sleep stage cannot be determined, and as such it now refers toasleepUnspecified
.