From 156149db28131ad57ca2cf6665745a2a340cef60 Mon Sep 17 00:00:00 2001 From: Amy Jeanes Date: Sun, 13 Sep 2026 21:31:13 +0100 Subject: [PATCH] models: don't freeze the ui on an unset LagdToggleDelay (#2026) models: don't block the ui on an unset LagdToggleDelay Params.get's second positional is `block`, not a fallback value, so get("LagdToggleDelay", "0.2") passes block=True and does a blocking read. When the param is unset this spins the ui thread until it appears, freezing the models panel (the description is rebuilt every frame). Read it the same way livedelay/lagd_toggle.py does. Claude-Session: https://claude.ai/code/session_01EGMnVnSk5inGTrd7kuDVG9 Co-authored-by: Claude Opus 4.8 (1M context) Co-authored-by: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com> --- openpilot/selfdrive/ui/sunnypilot/layouts/settings/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpilot/selfdrive/ui/sunnypilot/layouts/settings/models.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/models.py index 30804dc96..8d014828c 100644 --- a/openpilot/selfdrive/ui/sunnypilot/layouts/settings/models.py +++ b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/models.py @@ -115,7 +115,7 @@ class ModelsLayout(Widget): if lagd_toggle: desc += f"
{tr('Live Steer Delay:')} {ui_state.sm['lateralDelay'].lateralDelay:.3f} s" elif ui_state.CP is not None: - sw = float(ui_state.params.get("LagdToggleDelay", "0.2")) + sw = float(ui_state.params.get("LagdToggleDelay", return_default=True)) cp = ui_state.CP.steerActuatorDelay desc += f"
{tr('Actuator Delay:')} {cp:.2f} s + {tr('Software Delay:')} {sw:.2f} s = {tr('Total Delay:')} {cp + sw:.2f} s" self.lagd_toggle.set_description(desc)