fix: Minor fixes

- speed unit
- screen cleared
This commit is contained in:
Piotr Dec 2024-08-15 22:23:32 +02:00
parent 9758da2a10
commit 01f75a466f
Signed by: stawros
GPG key ID: F89F27AD8F881A91
2 changed files with 2 additions and 1 deletions

View file

@ -202,6 +202,7 @@ class Garmin(
sleep(3000)
readAll()
send(intArrayOf(0x07, 0x01)) // Set GPS to true
send(intArrayOf(0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)) // Clear screen
while (true) {
val newCurrent = queue.poll()
if (newCurrent == null) {

View file

@ -106,7 +106,7 @@ class MapboxMapper {
fun asSpeed(locationMatcherResult: LocationMatcherResult): Speed {
return Speed(
locationMatcherResult.enhancedLocation.speed.let { it?.toInt() ?: 0 },
locationMatcherResult.enhancedLocation.speed.let { it?.let { it / 1000.0 * 3600 }?.toInt() ?: 0 },
locationMatcherResult.speedLimitInfo.speed.let { it ?: 0 },
)