From 7a50a52a9d01c175bd6cd3c7f90c4ca6239107ee Mon Sep 17 00:00:00 2001 From: Meng Li <34143965+Meng6@users.noreply.github.com> Date: Tue, 9 Mar 2021 23:25:21 -0500 Subject: [PATCH] Migrate phone light sensor to new data stream --- docs/datastreams/aware-mysql.md | 20 ++++++++++++++++++++ docs/datastreams/mandatory-phone-format.md | 10 ++++++++++ src/data/streams/aware_mysql/format.yaml | 12 +++++++++++- src/data/streams/rapids_columns.yaml | 6 ++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/docs/datastreams/aware-mysql.md b/docs/datastreams/aware-mysql.md index 56e4d227..9d8c5e45 100644 --- a/docs/datastreams/aware-mysql.md +++ b/docs/datastreams/aware-mysql.md @@ -346,5 +346,25 @@ Stream columns named `FLAG_TO_MUTATE` means they are extracted based on the `MUT - if stream's `double_convo_end` field is smaller than 9999999999, it is in seconds instead of milliseconds. Set `DOUBLE_CONVO_END` = 1000 * `double_convo_end`. +??? info "PHONE_LIGHT" + === "ANDROID" + + **RAPIDS_COLUMN_MAPPINGS** + + | RAPIDS column | Stream column | + |----------------------|---------------------| + | TIMESTAMP | timestamp | + | DEVICE_ID | device_id | + | DOUBLE_LIGHT_LUX | double_light_lux | + | ACCURACY | accuracy | + + **MUTATION** + + - **COLUMN_MAPPINGS** (None) + - **SCRIPTS** (None) + + === "IOS" + + This sensor is not supported by iOS devices. diff --git a/docs/datastreams/mandatory-phone-format.md b/docs/datastreams/mandatory-phone-format.md index ec570d68..3c4de06d 100644 --- a/docs/datastreams/mandatory-phone-format.md +++ b/docs/datastreams/mandatory-phone-format.md @@ -79,3 +79,13 @@ This is a description of the format RAPIDS needs to process data for the followi | DOUBLE_CONVO_START | UNIX timestamp (13 digits) of the beginning of a conversation | | DOUBLE_CONVO_END | UNIX timestamp (13 digits) of the end of a conversation | + +??? info "PHONE_LIGHT" + + | RAPIDS column | Description | + |--------------------|----------------------------------------------------------------------------------------------------------------------| + | TIMESTAMP | An UNIX timestamp (13 digits) when a row of data was logged | + | DEVICE_ID | A string that uniquely identifies a device | + | DOUBLE_LIGHT_LUX | The ambient luminance in lux units | + | ACCURACY | An integer that denotes the sensor's accuracy level: 3 = maximum accuracy, 2 = medium accuracy, 1 = low accuracy | + diff --git a/src/data/streams/aware_mysql/format.yaml b/src/data/streams/aware_mysql/format.yaml index a6d1c151..ab7e0482 100644 --- a/src/data/streams/aware_mysql/format.yaml +++ b/src/data/streams/aware_mysql/format.yaml @@ -129,7 +129,6 @@ PHONE_CONVERSATION: MUTATION: COLUMN_MAPPINGS: SCRIPTS: # List any python or r scripts that mutate your raw data - IOS: RAPIDS_COLUMN_MAPPINGS: TIMESTAMP: timestamp @@ -142,3 +141,14 @@ PHONE_CONVERSATION: COLUMN_MAPPINGS: SCRIPTS: # List any python or r scripts that mutate your raw data - "src/data/streams/mutations/phone/aware/conversation_ios_timestamp.R" + +PHONE_LIGHT: + ANDROID: + RAPIDS_COLUMN_MAPPINGS: + TIMESTAMP: timestamp + DEVICE_ID: device_id + DOUBLE_LIGHT_LUX: double_light_lux + ACCURACY: accuracy + MUTATION: + COLUMN_MAPPINGS: + SCRIPTS: # List any python or r scripts that mutate your raw data diff --git a/src/data/streams/rapids_columns.yaml b/src/data/streams/rapids_columns.yaml index 4c974ee0..4aecdadc 100644 --- a/src/data/streams/rapids_columns.yaml +++ b/src/data/streams/rapids_columns.yaml @@ -48,6 +48,12 @@ PHONE_CONVERSATION: - DOUBLE_CONVO_START - DOUBLE_CONVO_END +PHONE_LIGHT: + - TIMESTAMP + - DEVICE_ID + - DOUBLE_LIGHT_LUX + - ACCURACY + FITBIT_STEPS_SUMMARY: - TIMESTAMP