Fix distance to destination retrieval (#63)
This commit is contained in:
parent
aaeb1204bf
commit
245243eedd
@ -7,5 +7,5 @@
|
||||
"latestVersionCode": 15,
|
||||
"developer": "timklge",
|
||||
"description": "Provides headwind direction, wind speed and other weather data fields",
|
||||
"releaseNotes": "* Forecast weather along route in fixed intervals if route is loaded\n* Show current weather in app menu\n*Add individual forecast fields"
|
||||
"releaseNotes": "* Add individual forecast fields\n* Fix forecast along route distance update"
|
||||
}
|
||||
@ -118,8 +118,7 @@ fun KarooSystemService.streamUpcomingRoute(): Flow<UpcomingRoute?> {
|
||||
emit(null)
|
||||
|
||||
streamDataFlow(DataType.Type.DISTANCE_TO_DESTINATION)
|
||||
.map { (it as? StreamState.Streaming)?.dataPoint?.singleValue }
|
||||
.filter { it != 0.0 } // FIXME why is 0 sometimes emitted if no route is loaded?
|
||||
.map { (it as? StreamState.Streaming)?.dataPoint?.values?.get(DataType.Field.DISTANCE_TO_DESTINATION) }
|
||||
.collect { emit(it) }
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user