sunnypilot: disable speed limit control

This commit is contained in:
1okko
2026-09-28 19:48:10 +08:00
parent 33ff042425
commit 8ff4f0eb43
3 changed files with 15 additions and 1 deletions
Binary file not shown.
+1 -1
View File
@@ -271,7 +271,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"RoadNameToggle", {PERSISTENT | BACKUP, BOOL, "0"}},
// Speed Limit
{"SpeedLimitMode", {PERSISTENT | BACKUP, INT, "1"}},
{"SpeedLimitMode", {PERSISTENT | BACKUP, INT, "0"}},
{"SpeedLimitOffsetType", {PERSISTENT | BACKUP, INT, "0"}},
{"SpeedLimitPolicy", {PERSISTENT | BACKUP, INT, "3"}},
{"SpeedLimitValueOffset", {PERSISTENT | BACKUP, INT, "0"}},
@@ -84,6 +84,17 @@ def _migrate_tesla_mads_screen_button(_params):
cloudlog.exception(f"Error migrating TeslaMadsScreenButton: {e}")
def _disable_speed_limit_control(_params):
try:
from openpilot.sunnypilot.selfdrive.controls.lib.speed_limit.common import Mode as SpeedLimitMode
if _params.get("SpeedLimitMode", return_default=True) != int(SpeedLimitMode.off):
_params.put("SpeedLimitMode", int(SpeedLimitMode.off), block=True)
cloudlog.info("params_migration: disabled speed limit control")
except Exception as e:
cloudlog.exception(f"Error disabling speed limit control: {e}")
def _migrate_model_bundle_slots(_params):
# Pre-split, a chestnut user's big-model selection lived in the single
# ActiveBundle. Seed both slots; validation drops whichever does not match
@@ -142,3 +153,6 @@ def run_migration(_params):
# seed the chestnut model slot from the pre-split single slot
_migrate_model_bundle_slots(_params)
# speed limit settings menu is intentionally hidden on this build
_disable_speed_limit_control(_params)