mirror of
https://github.com/home-assistant/android
synced 2024-09-06 17:23:32 +00:00
Add some debug logs for heart rate sensor (#3111)
This commit is contained in:
parent
4ec5fbf1f0
commit
8563efef5f
|
@ -101,6 +101,10 @@ class HeartRateSensorManager : SensorManager, SensorEventListener {
|
|||
}
|
||||
|
||||
override fun onSensorChanged(event: SensorEvent?) {
|
||||
if (event?.sensor?.type == Sensor.TYPE_HEART_RATE) {
|
||||
Log.d(TAG, "HR event received with accuracy: ${getAccuracy(event.accuracy)} and value: ${event.values[0]}")
|
||||
} else
|
||||
Log.d(TAG, "No HR event received")
|
||||
if (
|
||||
event?.sensor?.type == Sensor.TYPE_HEART_RATE && event.accuracy !in skipAccuracy &&
|
||||
event.values[0].roundToInt() >= 0
|
||||
|
@ -125,6 +129,8 @@ class HeartRateSensorManager : SensorManager, SensorEventListener {
|
|||
SENSOR_STATUS_ACCURACY_HIGH -> "high"
|
||||
SENSOR_STATUS_ACCURACY_MEDIUM -> "medium"
|
||||
SENSOR_STATUS_ACCURACY_LOW -> "low"
|
||||
SENSOR_STATUS_UNRELIABLE -> "unreliable"
|
||||
SENSOR_STATUS_NO_CONTACT -> "no_contact"
|
||||
else -> "unknown"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue