From 8a25621e97fc022a56d0f3eb47be691832169cf7 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 27 Jan 2026 20:34:30 -0800 Subject: [PATCH] Toyota: clean up alpha long (#3074) * toyota: clean up alpha long * yes we have a test --- opendbc/car/toyota/interface.py | 9 ++++----- opendbc/car/toyota/tests/test_toyota.py | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opendbc/car/toyota/interface.py b/opendbc/car/toyota/interface.py index 9e2d332f..bda0a03a 100644 --- a/opendbc/car/toyota/interface.py +++ b/opendbc/car/toyota/interface.py @@ -106,12 +106,11 @@ class CarInterface(CarInterfaceBase): # TODO: make an adas dbc file for dsu-less models ret.radarUnavailable = Bus.radar not in DBC[candidate] or candidate in (NO_DSU_CAR - TSS2_CAR) - # since we don't yet parse radar on TSS2/TSS-P radar-based ACC cars, gate longitudinal behind experimental toggle - if candidate in (RADAR_ACC_CAR | NO_DSU_CAR): - ret.alphaLongitudinalAvailable = candidate in RADAR_ACC_CAR + # since we don't yet parse radar on TSS2 radar-based ACC cars, gate longitudinal behind experimental toggle + if candidate in RADAR_ACC_CAR: + ret.alphaLongitudinalAvailable = True - # Disabling radar is only supported on TSS2 radar-ACC cars - if alpha_long and candidate in RADAR_ACC_CAR: + if alpha_long: ret.flags |= ToyotaFlags.DISABLE_RADAR.value # openpilot longitudinal enabled by default: diff --git a/opendbc/car/toyota/tests/test_toyota.py b/opendbc/car/toyota/tests/test_toyota.py index 5ab47f35..2d07af54 100644 --- a/opendbc/car/toyota/tests/test_toyota.py +++ b/opendbc/car/toyota/tests/test_toyota.py @@ -18,6 +18,7 @@ def check_fw_version(fw_version: bytes) -> bool: class TestToyotaInterfaces: def test_car_sets(self): + # Angle and radar-ACC cars are always TSS2 cars assert len(ANGLE_CONTROL_CAR - TSS2_CAR) == 0 assert len(RADAR_ACC_CAR - TSS2_CAR) == 0