Kia Sorento: fix dash speed matching (#26582)

* exception for Sorento

* comment
This commit is contained in:
Shane Smiskol
2022-12-06 01:03:59 -08:00
committed by GitHub
parent ddae8ffc09
commit 2d5e2d992a

View File

@@ -72,8 +72,10 @@ class CarState(CarStateBase):
self.cluster_speed = cp.vl["CLU15"]["CF_Clu_VehicleSpeed"]
self.cluster_speed_counter = 0
# mimic how dash converts to imperial
if not self.is_metric:
# Mimic how dash converts to imperial.
# Sorento is the only platform where CF_Clu_VehicleSpeed is already imperial when not is_metric
# TODO: CGW_USM1->CF_Gway_DrLockSoundRValue may describe this
if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO,):
self.cluster_speed = math.floor(self.cluster_speed * CV.KPH_TO_MPH + CV.KPH_TO_MPH)
ret.vEgoCluster = self.cluster_speed * speed_conv