mirror of
https://github.com/home-assistant/android
synced 2024-07-22 10:54:12 +00:00
Skip heart rate value updates when below 0 (#3081)
This commit is contained in:
parent
c50ce30b5b
commit
382b26c4c3
|
@ -101,7 +101,10 @@ class HeartRateSensorManager : SensorManager, SensorEventListener {
|
|||
}
|
||||
|
||||
override fun onSensorChanged(event: SensorEvent?) {
|
||||
if (event?.sensor?.type == Sensor.TYPE_HEART_RATE && event.accuracy !in skipAccuracy) {
|
||||
if (
|
||||
event?.sensor?.type == Sensor.TYPE_HEART_RATE && event.accuracy !in skipAccuracy &&
|
||||
event.values[0].roundToInt() >= 0
|
||||
) {
|
||||
onSensorUpdated(
|
||||
latestContext,
|
||||
heartRate,
|
||||
|
|
Loading…
Reference in a new issue