From d4a3bc0f5cd7d6349cb865a51b58baa38886a886 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Thu, 23 Jul 2026 09:15:19 -0500 Subject: [PATCH] offroad alert key --- selfdrive/ui/mici/layouts/offroad_alerts.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/selfdrive/ui/mici/layouts/offroad_alerts.py b/selfdrive/ui/mici/layouts/offroad_alerts.py index f2952214b..375fc745d 100644 --- a/selfdrive/ui/mici/layouts/offroad_alerts.py +++ b/selfdrive/ui/mici/layouts/offroad_alerts.py @@ -14,6 +14,7 @@ from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.multilang import tr REFRESH_INTERVAL = 5.0 # seconds +EXCESSIVE_ACTUATION_ALERT_KEY = "Offroad_ExcessiveActuation" class AlertSize(IntEnum): @@ -212,6 +213,10 @@ class MiciOffroadAlerts(Scroller): def scrolling(self): return self._scroller.scroll_panel.is_touch_valid() + def _acknowledge_excessive_actuation(self): + self.params.remove(EXCESSIVE_ACTUATION_ALERT_KEY) + self.refresh() + def _build_alerts(self): """Build sorted list of alerts from OFFROAD_ALERTS.""" self.sorted_alerts = [] @@ -232,6 +237,8 @@ class MiciOffroadAlerts(Scroller): # Create alert item widget alert_item = AlertItem(alert_data) + if key == EXCESSIVE_ACTUATION_ALERT_KEY: + alert_item.set_click_callback(self._acknowledge_excessive_actuation) self.alert_items.append(alert_item) self._scroller.add_widget(alert_item) @@ -274,6 +281,8 @@ class MiciOffroadAlerts(Scroller): if alert_json: text = alert_json.get("text", "").replace("%1", alert_json.get("extra", "")) + if alert_data.key == EXCESSIVE_ACTUATION_ALERT_KEY: + text = f"{text} {tr('Tap to acknowledge.')}" alert_data.text = text alert_data.visible = bool(text)