CarInfo: detail sentence exception for Toyota stock longitudinal (#25331)

* Exception for 2022 RAV4

* Exception for all stock long Toyota

Exception for all stock long Toyota

* fix exception

fix

fix

fix
This commit is contained in:
Shane Smiskol
2022-08-01 17:44:22 -07:00
committed by GitHub
parent d810d45421
commit 35338196ac
2 changed files with 11 additions and 10 deletions
+6 -5
View File
@@ -147,11 +147,12 @@ class CarInfo:
else:
alc = ""
# Exception for Nissan and Subaru which do not auto-resume yet
if CP.carName not in ("nissan", "subaru"):
acc = f" <strong>while driving above {self.min_enable_speed * CV.MS_TO_MPH:.0f} mph</strong>" if self.min_enable_speed > 0 else " <strong>that automatically resumes from a stop</strong>"
else:
acc = ""
# Exception for Nissan, Subaru, and stock long Toyota which do not auto-resume yet
acc = ""
if self.min_enable_speed > 0:
acc = f" <strong>while driving above {self.min_enable_speed * CV.MS_TO_MPH:.0f} mph</strong>"
elif CP.carName not in ("nissan", "subaru", "toyota") or (CP.carName == "toyota" and CP.openpilotLongitudinalControl):
acc = " <strong>that automatically resumes from a stop</strong>"
if self.row[Column.STEERING_TORQUE] != Star.FULL:
sentence_builder += " This car may not be able to take tight turns on its own."
+5 -5
View File
@@ -83,7 +83,7 @@ def print_car_info_diff(path):
for new_car, base_car in car_changes:
# Tier changes
if base_car.tier != new_car.tier:
changes["tier"].append(f"- Tier for {base_car.make} {base_car.name} changed! ({base_car.tier.name.title()} {ARROW_SYMBOL} {new_car.tier.name.title()})")
changes["tier"].append(f"- Tier for {base_car.name} changed! ({base_car.tier.name.title()} {ARROW_SYMBOL} {new_car.tier.name.title()})")
# Column changes
row_diff = build_column_diff(base_car, new_car)
@@ -92,11 +92,11 @@ def print_car_info_diff(path):
# Detail sentence changes
if base_car.detail_sentence != new_car.detail_sentence:
changes["detail"].append(f"- Sentence for {base_car.make} {base_car.name} changed!\n" +
changes["detail"].append(f"- Sentence for {base_car.name} changed!\n" +
" ```diff\n" +
f" + {base_car.detail_sentence}\n" +
f" - {new_car.detail_sentence}\n" +
"```")
f" - {base_car.detail_sentence}\n" +
f" + {new_car.detail_sentence}\n" +
" ```")
# Print diff
if any(len(c) for c in changes.values()):