From 90adc18032732bc92320402ddf884730678e14ea Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 29 Sep 2025 19:18:52 -0400 Subject: [PATCH] MADS: enforce certain soft disable events by user when in motion (#1298) * MADS: enforce soft disable events by user when the vehicle is in motion * flipped --- sunnypilot/mads/mads.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sunnypilot/mads/mads.py b/sunnypilot/mads/mads.py index f16b68835..b75bd8ccd 100644 --- a/sunnypilot/mads/mads.py +++ b/sunnypilot/mads/mads.py @@ -102,12 +102,13 @@ class ModularAssistiveDrivingSystem: def update_events(self, CS: structs.CarState): if not self.selfdrive.enabled and self.enabled: - if self.events.has(EventName.doorOpen): - self.replace_event(EventName.doorOpen, EventNameSP.silentDoorOpen) - self.transition_paused_state() - if self.events.has(EventName.seatbeltNotLatched): - self.replace_event(EventName.seatbeltNotLatched, EventNameSP.silentSeatbeltNotLatched) - self.transition_paused_state() + if CS.standstill: + if self.events.has(EventName.doorOpen): + self.replace_event(EventName.doorOpen, EventNameSP.silentDoorOpen) + self.transition_paused_state() + if self.events.has(EventName.seatbeltNotLatched): + self.replace_event(EventName.seatbeltNotLatched, EventNameSP.silentSeatbeltNotLatched) + self.transition_paused_state() if self.events.has(EventName.wrongGear) and (CS.vEgo < 2.5 or CS.gearShifter == GearShifter.reverse): self.replace_event(EventName.wrongGear, EventNameSP.silentWrongGear) self.transition_paused_state()