mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-10-27 08:43:41 +08:00
chestnut: show switch branch alert only on release (#39049)
chestnut: only show branch alert on release branches
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import time
|
||||
|
||||
from openpilot.common.hardware.usb import CHESTNUT_USB_PRODUCT, is_chestnut_usb_id
|
||||
from openpilot.common.version import RELEASE_BRANCHES
|
||||
|
||||
|
||||
CHESTNUT_RELEASE_BRANCHES = ("release-chestnut", "release-chestnut-staging", "nightly-chestnut", "nightly-chestnut-dev")
|
||||
@@ -82,7 +83,7 @@ class ChestnutStatus:
|
||||
release = branch in CHESTNUT_RELEASE_BRANCHES
|
||||
missing = self.usb_failed or (offroad and release and time.monotonic() - self.started > 10. and len(detected) != 1)
|
||||
slow_usb = offroad and len(devices) == 1 and devices[0]["speedMbps"] < 5000
|
||||
set_alert("Offroad_ChestnutBranch", not release and len(devices) == 1)
|
||||
set_alert("Offroad_ChestnutBranch", branch in RELEASE_BRANCHES and not release and len(devices) == 1)
|
||||
set_alert("Offroad_ChestnutNotDetected", missing)
|
||||
set_alert("Offroad_ChestnutOverheated", self.overheated, f"{state.tempC:.0f} °C" if state is not None else None)
|
||||
set_alert("Offroad_ChestnutUsbSlow", slow_usb, f"{devices[0]['speedMbps']} Mbps" if slow_usb else None)
|
||||
|
||||
Reference in New Issue
Block a user