diff --git a/openpilot/common/libparams_c.so b/openpilot/common/libparams_c.so index 10f623fae..bc92a50b4 100755 Binary files a/openpilot/common/libparams_c.so and b/openpilot/common/libparams_c.so differ diff --git a/openpilot/common/params_keys.h b/openpilot/common/params_keys.h index 6e4ada136..e56bf7186 100644 --- a/openpilot/common/params_keys.h +++ b/openpilot/common/params_keys.h @@ -9,6 +9,7 @@ inline static std::unordered_map keys = { {"AccessToken", {CLEAR_ON_MANAGER_START | DONT_LOG, STRING}}, {"AdbEnabled", {PERSISTENT | BACKUP, BOOL}}, {"AlwaysOnDM", {PERSISTENT | BACKUP, BOOL}}, + {"BeepEnabled", {PERSISTENT | BACKUP, BOOL, "1"}}, {"ApiCache_Device", {PERSISTENT, STRING}}, {"ApiCache_FirehoseStats", {PERSISTENT, JSON}}, {"AssistNowToken", {PERSISTENT, STRING}}, diff --git a/openpilot/selfdrive/selfdrived/beep.py b/openpilot/selfdrive/selfdrived/beep.py index e92f195cc..e8d4c466d 100644 --- a/openpilot/selfdrive/selfdrived/beep.py +++ b/openpilot/selfdrive/selfdrived/beep.py @@ -5,6 +5,7 @@ import threading import openpilot.cereal.messaging as messaging from opendbc.car.structs import car +from openpilot.common.params import Params from openpilot.common.realtime import Ratekeeper AudibleAlert = car.CarControl.HUDControl.AudibleAlert @@ -12,6 +13,7 @@ AudibleAlert = car.CarControl.HUDControl.AudibleAlert class Beepd: def __init__(self): self.current_alert = AudibleAlert.none + self.params = Params() self.enable_gpio() #self.startup_beep() @@ -32,6 +34,8 @@ class Beepd: encoding='utf8') def _beep(self, on): + if on and not self.params.get_bool("BeepEnabled"): + return val = "1" if on else "0" subprocess.run(f"echo \"{val}\" | sudo tee /sys/class/gpio/gpio42/value", shell=True, diff --git a/openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py index 84be5a26a..e960b7745 100644 --- a/openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py +++ b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py @@ -28,6 +28,11 @@ class VisualsLayout(Widget): def _initialize_items(self): self._toggle_defs = { + "BeepEnabled": ( + lambda: tr("Alert Beeper"), + tr("Play engage, disengage, and warning beeps using the hardware beeper."), + None, + ), "BlindSpot": ( lambda: tr("Show Blind Spot Warnings"), tr("Enabling this will display warnings when a vehicle is detected in your " + diff --git a/openpilot/selfdrive/ui/translations/app.pot b/openpilot/selfdrive/ui/translations/app.pot index 660bf221f..ab1600a14 100644 --- a/openpilot/selfdrive/ui/translations/app.pot +++ b/openpilot/selfdrive/ui/translations/app.pot @@ -2812,3 +2812,11 @@ msgstr "" #: openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/honda.py msgid "Use Bosch-A Radar Data" msgstr "" + +#: openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py +msgid "Alert Beeper" +msgstr "" + +#: openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py +msgid "Play engage, disengage, and warning beeps using the hardware beeper." +msgstr "" diff --git a/openpilot/selfdrive/ui/translations/app_zh-CHS.po b/openpilot/selfdrive/ui/translations/app_zh-CHS.po index 80b918734..a98fe237b 100644 --- a/openpilot/selfdrive/ui/translations/app_zh-CHS.po +++ b/openpilot/selfdrive/ui/translations/app_zh-CHS.po @@ -2899,3 +2899,11 @@ msgstr "读取原厂 Bosch-A 雷达目标,仅接收不发送,不影响原车 #: openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/honda.py msgid "Use Bosch-A Radar Data" msgstr "使用雷达信息" + +#: openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py +msgid "Alert Beeper" +msgstr "提示音" + +#: openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py +msgid "Play engage, disengage, and warning beeps using the hardware beeper." +msgstr "使用硬件蜂鸣器播放接管、退出和警告提示音。"