Skip to content

Commit

Permalink
Merge pull request #336 from this-Aditya/google-sleep
Browse files Browse the repository at this point in the history
Schemas added for google sleep APIs
  • Loading branch information
blootsvoets authored Jun 20, 2023
2 parents 662fc1c + 7e6468a commit 0137ea8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
13 changes: 13 additions & 0 deletions commons/passive/google/google_sleep_classify_event.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"namespace": "org.radarcns.passive.google",
"type": "record",
"name": "GoogleSleepClassifyEvent",
"doc": "Sleep classification event that indicates that the user is probably sleeping. Includes sleep confidence, device motion and ambient light level.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "timeReceived", "type": "double", "doc": "Device receiver timestamp in UTC (s)." },
{ "name": "sleepConfidence", "type": "float", "doc": "Sleep confidence value between 0-1. Higher value indicate that the user is more likely sleeping, while lower values indicate that the user is more likely awake." },
{ "name": "light", "type": "int", "doc": "The brightness of the space around the device, based on the device's ambient light sensor readings. Value ranges from 1 to 6, inclusive. Higher values indicate brighter surroundings, while lower values indicate darker surroundings." },
{ "name": "motion", "type": "int", "doc": "The amount of device motion, based on the device's accelerometer readings. Value ranges from 1 to 6, inclusive. Higher values indicate more movement of the device." }
]
}
17 changes: 17 additions & 0 deletions commons/passive/google/google_sleep_segment_event.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"namespace": "org.radarcns.passive.google",
"type": "record",
"name": "GoogleSleepSegmentEvent",
"doc": "Represents the result of sleep data after the user is awake.",
"fields": [
{ "name": "time", "type": "double", "doc": "The UNIX epoch time (s) for the moment when the user goes to sleep." },
{ "name": "timeReceived", "type": "double", "doc": "Device receiver timestamp in UTC (s)." },
{ "name": "endTime", "type": "double", "doc": "The UNIX epoch time (s) for the moment when the user wakes up." },
{ "name": "status", "type": {
"name": "SleepClassificationStatus",
"type": "enum",
"doc": "The status of the sleep segment detection. \nSUCCESSFUL indicates successful detection of sleep segment in the past day.\nNOT_DETECTED indicates Sleep segment is not detected in the past day, or there isn't enough confidence that the user slept during the past day. This could happen for a variety of reasons, including the following: too much missing data, the user sleeps with the light, the user interacts with their device often, or the user's device doesn't support the sensors needed for sleep detection. \nMISSING_DATA indicates sleep segment was detected, but there was some missing data near the detected sleep segment. This could happen for a variety of reasons, including the following: the user turned off their device, the user delayed logging into their device after a system reboot or system upgrade, or an event occurred that paused the detection.",
"symbols": ["SUCCESSFUL", "MISSING_DATA", "NOT_DETECTED", "UNKNOWN"]
}, "doc": "Status that indicates whether the system succeeded in detecting sleep.", "default": "UNKNOWN" }
]
}
23 changes: 23 additions & 0 deletions specifications/passive/android_google-1.0.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#======================================== Google APIs =============================================#
vendor: GOOGLE
model: SLEEP
version: 1.0.0
data:
#Google Sleep
- type: SLEEP_SEGMENT_EVENT
app_provider: .google.GoogleSleepProvider
unit: NON_DIMENSIONAL
processing_state: RAW
topic: android_google_sleep_segment_event
value_schema: .passive.google.GoogleSleepSegmentEvent
sample_rate:
dynamic: true
- type: SLEEP_CLASSIFY_EVENT
app_provider: .google.GoogleSleepProvider
unit: NON_DIMENSIONAL
processing_state: RAW
topic: android_google_sleep_classify_event
value_schema: .passive.google.GoogleSleepClassifyEvent
sample_rate:
interval: 600
dynamic: true

0 comments on commit 0137ea8

Please sign in to comment.