DM: fix always on permanent lockout (#35834)

fix check and comments
This commit is contained in:
Shane Smiskol
2025-07-28 13:17:02 -07:00
committed by GitHub
parent 18970781ba
commit 64d8be9176
+4 -4
View File
@@ -309,15 +309,15 @@ class DriverMonitoring:
def _update_events(self, driver_engaged, op_engaged, standstill, wrong_gear, car_speed):
self._reset_events()
# Block engaging after max number of distrations or when alert active
# Block engaging until ignition cycle after max number or time of distractions
if self.terminal_alert_cnt >= self.settings._MAX_TERMINAL_ALERTS or \
self.terminal_time >= self.settings._MAX_TERMINAL_DURATION or \
self.always_on and self.awareness <= self.threshold_prompt:
self.terminal_time >= self.settings._MAX_TERMINAL_DURATION:
if not self.too_distracted:
self.params.put_bool_nonblocking("DriverTooDistracted", True)
self.too_distracted = True
if self.too_distracted:
# Always-on distraction lockout is temporary
if self.too_distracted or (self.always_on and self.awareness <= self.threshold_prompt):
self.current_events.add(EventName.tooDistracted)
always_on_valid = self.always_on and not wrong_gear