Zikeji's Dilemma

This commit is contained in:
firestar5683
2026-06-04 23:32:57 -05:00
parent 2aaad84ab6
commit 4c27f3cd5e
2 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -1083,7 +1083,7 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
"",
AlertStatus.normal, AlertSize.full,
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2, creation_delay=0.5),
ET.USER_DISABLE: ImmediateDisableAlert("Reverse Gear"),
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
ET.NO_ENTRY: NoEntryAlert("Reverse Gear"),
},
@@ -1478,7 +1478,7 @@ if HARDWARE.get_device_type() == 'mici':
"",
AlertStatus.normal, AlertSize.full,
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2, creation_delay=0.5),
ET.USER_DISABLE: ImmediateDisableAlert("Reverse"),
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
ET.NO_ENTRY: NoEntryAlert("Reverse"),
},
})
+10
View File
@@ -13,6 +13,8 @@ from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert
from openpilot.selfdrive.test.process_replay.process_replay import CONFIGS
AlertSize = log.SelfdriveState.AlertSize
AudibleAlert = car.CarControl.HUDControl.AudibleAlert
EventName = log.OnroadEvent.EventName
OFFROAD_ALERTS_PATH = os.path.join(BASEDIR, "selfdrive/selfdrived/alerts_offroad.json")
@@ -104,6 +106,14 @@ class TestAlerts:
if event_type not in (ET.WARNING, ET.PERMANENT, ET.PRE_ENABLE):
assert a.creation_delay == 0.
def test_reverse_gear_user_disable_is_normal_disengage(self):
alert = EVENTS[EventName.reverseGear][ET.USER_DISABLE]
assert isinstance(alert, Alert)
assert alert.alert_text_1 == ""
assert alert.alert_text_2 == ""
assert alert.alert_size == AlertSize.none
assert alert.audible_alert == AudibleAlert.disengage
def test_offroad_alerts(self):
params = Params()
for a in self.offroad_alerts: