Toyota: remove redundant car set union (#29546)

remove confusing union
old-commit-hash: 16a8c9fbf1
This commit is contained in:
Shane Smiskol
2023-08-22 21:09:33 -07:00
committed by GitHub
parent e9a497dc5b
commit 5949a8d3c6
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ class CarState(CarStateBase):
cp_acc = cp_cam if self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR) else cp
if self.CP.carFingerprint in (TSS2_CAR | RADAR_ACC_CAR):
if self.CP.carFingerprint in TSS2_CAR:
if not (self.CP.flags & ToyotaFlags.SMART_DSU.value):
self.acc_type = cp_acc.vl["ACC_CONTROL"]["ACC_TYPE"]
ret.stockFcw = bool(cp_acc.vl["PCS_HUD"]["FCW"])
+3 -2
View File
@@ -2,14 +2,15 @@
from cereal import car
import unittest
from openpilot.selfdrive.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, FW_VERSIONS
from openpilot.selfdrive.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC_CAR, FW_VERSIONS
Ecu = car.CarParams.Ecu
class TestToyotaInterfaces(unittest.TestCase):
def test_angle_car_set(self):
def test_car_sets(self):
self.assertTrue(len(ANGLE_CONTROL_CAR - TSS2_CAR) == 0)
self.assertTrue(len(RADAR_ACC_CAR - TSS2_CAR) == 0)
def test_tss2_dbc(self):
# We make some assumptions about TSS2 platforms,