-
Notifications
You must be signed in to change notification settings - Fork 15
Add Driver for Oura Ring #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
nickgaray
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update copyright dates, make sure all classes are org.sensorhub, update class headers with proper info in noted annotations
| // @DisplayInfo(desc = "User Oura Cloud Token") | ||
| // public String bearerToken; | ||
|
|
||
| // Mike: KOZ6PJWLHIFJLUHXYYT5FW5Z7D62N7VQ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove secrets from file
| /** | ||
| * The unique identifier for the configured sensor (or sensor platform). | ||
| */ | ||
| // @DisplayInfo.Required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If serial number and bearer token are not needed, then they should be removed
| osgi { | ||
| manifest { | ||
| attributes ('Bundle-Vendor': 'Botts Inc') | ||
| attributes ('Bundle-Activator': 'com.sample.impl.sensor.drivername.Activator') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package name should start with org.sensorhub if this is intended for open source. This comment applies to all .java files as well
| WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
| for the specific language governing rights and limitations under the License. | ||
|
|
||
| Copyright (C) 2020-2021 Botts Innovative Research, Inc. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do copyrights need updating? Date?
| /** | ||
| * Descriptor classes provide access to informative data on the OpenSensorHub driver | ||
| * | ||
| * @author your_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit class headers with correct annotations
| // TODO: Create data record description | ||
| dataStruct = sweFactory.createRecord() | ||
| .name(SENSOR_OUTPUT_NAME) | ||
| .definition("urn:osh:data:oura:spo2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definition should be an ontological uri and not a unique identifier urn
|
|
||
| private Thread worker; | ||
|
|
||
| private String bearerToken; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bearerToken is not used so remove it
| System.out.println(record.get(0) + " | " + record.get(1) + " | " + record.get(2)); // ID | Name | Token | ||
| String sleep_response = makeRequest(requestString, record.get(2)); // record(2) = Token | ||
| JSONObject[] sleep_jsons = getDataRecord(sleep_response, record); | ||
| System.out.println("Number of Sleep Records for " + record.get(1) + " : " + sleep_jsons.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use logger
| System.out.println("Number of Rings Monitored: " + records.size()); | ||
| JSONObject[] sum_sleep_jsons = new JSONObject[0]; | ||
| for (List<String> record : records) { | ||
| System.out.println(record.get(0) + " | " + record.get(1) + " | " + record.get(2)); // ID | Name | Token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use logger
| // TODO: Create data record description | ||
| dataStruct = sweFactory.createRecord() | ||
| .name(SENSOR_OUTPUT_NAME) | ||
| .definition("urn:osh:data:oura:sleep") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definition should be an ontological definition URI
Sensor driver for Oura Ring. Supports multiple rings. Must add ring data to resources/Oura.csv.