public enum SleepStage
- Object
- Enum<SleepStage>
- SleepStage
ImplementsComparable<SleepStage>
One stage within a SleepSample. The values mirror Health Connect’s
eight stage constants; the iOS mapping is noted per value.
Not every source reports stages. Check
SleepSample.hasStageDetail() before drawing a hypnogram – a session
recorded by a phone rather than a watch will only say “asleep”.
Enum constants
UNKNOWN | The source did not classify this span. |
AWAKE | Awake during the sleep session. |
AWAKE_IN_BED | Awake but in bed, before or after sleeping. |
OUT_OF_BED | Out of bed during the session. |
ASLEEP_UNSPECIFIED | Asleep, with no stage breakdown available. |
LIGHT | Light sleep, as Health Connect classifies it – the N1 and N2 stages. |
CORE | Apple’s “core” sleep, from HealthKit asleepCore (iOS 16+). |
DEEP | Deep sleep. |
REM | REM sleep. |
Methods
public static SleepStage[] values() | |
public static SleepStage valueOf(String name) |
Inherited methods
Enum constant details
UNKNOWN
UNKNOWNAWAKE
AWAKEawake.AWAKE_IN_BED
AWAKE_IN_BEDinBed.OUT_OF_BED
OUT_OF_BEDASLEEP_UNSPECIFIED
ASLEEP_UNSPECIFIEDasleepUnspecified, and the only asleep value iOS reported before
iOS 16.LIGHT
LIGHTLight sleep, as Health Connect classifies it – the N1 and N2 stages.
HealthKit does not report this. Its nearest value is asleepCore,
which arrives as CORE rather than being folded in here.
CORE
COREApple’s “core” sleep, from HealthKit asleepCore (iOS 16+).
Its own value rather than a synonym for LIGHT. This used to be
mapped there with the approximation written into the javadoc, and a
documented approximation is still a value the caller cannot tell
from a real one: an app drawing a hypnogram, or comparing a night on
iOS with a night on Android, was handed Apple’s classification
labelled as the clinical one.
Apple’s core is a vendor classification and is not clinically identical to N1+N2. If your reading of the two is the same, treat them the same; the API will not do it for you.
DEEP
DEEPasleepDeep, iOS 16+.REM
REMasleepREM, iOS 16+.Method details
values
public static SleepStage[] values()valueOf
public static SleepStage valueOf(String name)