From 978ee190051806f8e5b7b8fede6b6be4e4db4aae Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 11 Feb 2025 23:03:10 -0600 Subject: [PATCH] Missing Safety references (#2146) * forgot these * fix that --- README.md | 5 +++-- python/__init__.py | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d1019d9b..b906d03f 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,8 @@ For example, to receive CAN messages: ``` And to send one on bus 0: ``` python ->>> panda.set_safety_mode(Panda.SAFETY_ALLOUTPUT) +>>> from opendbc.safety import Safety +>>> panda.set_safety_mode(Safety.SAFETY_ALLOUTPUT) >>> panda.can_send(0x1aa, b'message', 0) ``` Note that you may have to setup [udev rules](https://github.com/commaai/panda/tree/master/drivers/linux) for Linux, such as @@ -90,7 +91,7 @@ EOF sudo udevadm control --reload-rules && sudo udevadm trigger ``` -The panda jungle uses different udev rules. See [the repo](https://github.com/commaai/panda_jungle#udev-rules) for instructions. +The panda jungle uses different udev rules. See [the repo](https://github.com/commaai/panda_jungle#udev-rules) for instructions. ## Software interface support diff --git a/python/__init__.py b/python/__init__.py index 6c6d166b..e548704c 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -9,8 +9,6 @@ import binascii from functools import wraps, partial from itertools import accumulate -from opendbc.safety import Safety - from .base import BaseHandle from .constants import FW_PATH, McuType from .dfu import PandaDFU @@ -714,7 +712,7 @@ class Panda: def set_power_save(self, power_save_enabled=0): self._handle.controlWrite(Panda.REQUEST_OUT, 0xe7, int(power_save_enabled), 0, b'') - def set_safety_mode(self, mode=Safety.SAFETY_SILENT, param=0): + def set_safety_mode(self, mode=0, param=0): # Safety.SAFETY_SILENT self._handle.controlWrite(Panda.REQUEST_OUT, 0xdc, mode, param, b'') def set_obd(self, obd):