Block users from using development branches

This commit is contained in:
James
2025-12-01 12:00:00 -07:00
parent ffd7259193
commit b2d94a9f0d
13 changed files with 67 additions and 10 deletions
+8
View File
@@ -1040,6 +1040,14 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
# FrogPilot variables
FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
FrogPilotEventName.blockUser: {
ET.PERMANENT: Alert(
"Don't use the 'Development' branch!",
"Forcing you into 'Dashcam Mode' for your safety...",
AlertStatus.critical, AlertSize.mid,
Priority.HIGHEST, VisualAlert.none, AudibleAlert.warningImmediate, 1.),
},
FrogPilotEventName.customStartupAlert: {
ET.PERMANENT: custom_startup_alert,
},
+6 -1
View File
@@ -4,6 +4,7 @@ import time
import threading
import cereal.messaging as messaging
import openpilot.system.sentry as sentry
from cereal import car, custom, log
from msgq.visionipc import VisionIpcClient, VisionStreamType
@@ -158,6 +159,10 @@ class SelfdriveD:
self.FPCP = messaging.log_from_bytes(self.params.get("FrogPilotCarParams", block=True), custom.FrogPilotCarParams)
if self.frogpilot_toggles.block_user:
self.startup_event = FrogPilotEventName.blockUser
sentry.capture_block()
def update_events(self, CS):
"""Compute onroadEvents from carState"""
@@ -174,7 +179,7 @@ class SelfdriveD:
# Add startup event
if self.startup_event is not None:
if self.startup_event in (FrogPilotEventName.customStartupAlert):
if self.startup_event in (FrogPilotEventName.blockUser, FrogPilotEventName.customStartupAlert):
self.frogpilot_events.add(self.startup_event)
else:
self.events.add(self.startup_event)