From 39102d761dadf78d80c5fb2ef1aee4917b758e9e Mon Sep 17 00:00:00 2001 From: nayan8teen Date: Sat, 7 Jun 2025 13:14:30 -0400 Subject: [PATCH] lint --- selfdrive/car/card.py | 2 +- sunnypilot/selfdrive/car/tests/test_custom_cruise.py | 10 +++++----- sunnypilot/selfdrive/car/vcruise_helper.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/selfdrive/car/card.py b/selfdrive/car/card.py index c1a3dfc4da..8459f0785a 100755 --- a/selfdrive/car/card.py +++ b/selfdrive/car/card.py @@ -217,7 +217,7 @@ class Car: if can_rcv_valid and REPLAY: self.can_log_mono_time = messaging.log_from_bytes(can_strs[0]).logMonoTime - self.v_cruise_helper.update_v_cruise(CS, self.sm['carControl'].enabled, self.is_metric, self.custom_acc) + self.v_cruise_helper.update_v_cruise_sp(CS, self.sm['carControl'].enabled, self.is_metric, self.custom_acc) if self.sm['carControl'].enabled and not self.CC_prev.enabled: # Use CarState w/ buttons from the step selfdrived enables on self.v_cruise_helper.initialize_v_cruise(self.CS_prev, self.experimental_mode, self.dynamic_experimental_control) diff --git a/sunnypilot/selfdrive/car/tests/test_custom_cruise.py b/sunnypilot/selfdrive/car/tests/test_custom_cruise.py index fde5d7b751..0a97503f47 100644 --- a/sunnypilot/selfdrive/car/tests/test_custom_cruise.py +++ b/sunnypilot/selfdrive/car/tests/test_custom_cruise.py @@ -20,7 +20,7 @@ class TestAdjustCustomAccIncrements: def reset_cruise_speed_state(self): # Two resets previous cruise speed for _ in range(2): - self.v_cruise_helper.update_v_cruise(car.CarState(cruiseState={"available": False}), enabled=False, is_metric=False, custom_acc=(False, 1, 5)) + self.v_cruise_helper.update_v_cruise_sp(car.CarState(cruiseState={"available": False}), enabled=False, is_metric=False, custom_acc=(False, 1, 5)) def enable(self, v_ego, experimental_mode, dynamic_experimental_control): # Simulates user pressing set with a current speed @@ -49,10 +49,10 @@ class TestAdjustCustomAccIncrements: for i in range(51): CS.buttonEvents = [ButtonEvent(type=btn, pressed=True)] if i == 0 else [] - self.v_cruise_helper.update_v_cruise(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params)) + self.v_cruise_helper.update_v_cruise_sp(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params)) CS.buttonEvents = [ButtonEvent(type=btn, pressed=False)] - self.v_cruise_helper.update_v_cruise(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params)) + self.v_cruise_helper.update_v_cruise_sp(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params)) curr = self.v_cruise_helper.v_cruise_kph if metric else round(self.v_cruise_helper.v_cruise_kph / IMPERIAL_INCREMENT) diff = curr - prev @@ -80,9 +80,9 @@ class TestAdjustCustomAccIncrements: # simulate short-press CS.buttonEvents = [ButtonEvent(type=btn, pressed=True)] - self.v_cruise_helper.update_v_cruise(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params)) + self.v_cruise_helper.update_v_cruise_sp(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params)) CS.buttonEvents = [ButtonEvent(type=btn, pressed=False)] - self.v_cruise_helper.update_v_cruise(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params)) + self.v_cruise_helper.update_v_cruise_sp(CS, True, metric, sunnypilot_interfaces.custom_acc_controls(self.params)) curr = self.v_cruise_helper.v_cruise_kph if metric else round(self.v_cruise_helper.v_cruise_kph / IMPERIAL_INCREMENT) diff = curr - prev diff --git a/sunnypilot/selfdrive/car/vcruise_helper.py b/sunnypilot/selfdrive/car/vcruise_helper.py index effe1f5fa4..6f6dc739a7 100644 --- a/sunnypilot/selfdrive/car/vcruise_helper.py +++ b/sunnypilot/selfdrive/car/vcruise_helper.py @@ -22,7 +22,7 @@ class VCruiseHelperSP(VCruiseHelper): self.short_increment = 1 self.long_increment = 5 - def update_v_cruise(self, CS, enabled, is_metric, custom_acc: tuple[bool, int, int]) -> None: + def update_v_cruise_sp(self, CS, enabled, is_metric, custom_acc: tuple[bool, int, int]) -> None: super().update_v_cruise(CS, enabled, is_metric) self.custom_acc_enabled = custom_acc[0] self.short_increment = custom_acc[1]