python: disable power save by default when setting safety mode (#725)

* python: disable power save by default when setting safety mode

* no need to set power save manually

* Update python/__init__.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
Greg Hogan
2021-09-23 23:12:36 -07:00
committed by GitHub
parent 2570770f7b
commit fcd064345a
2 changed files with 3 additions and 3 deletions

View File

@@ -453,10 +453,11 @@ class Panda(object):
self._handle.controlWrite(Panda.REQUEST_OUT, 0xda, int(bootmode), 0, b'')
time.sleep(0.2)
def set_safety_mode(self, mode=SAFETY_SILENT, disable_heartbeat=True):
def set_safety_mode(self, mode=SAFETY_SILENT, disable_checks=True):
self._handle.controlWrite(Panda.REQUEST_OUT, 0xdc, mode, 0, b'')
if disable_heartbeat:
if disable_checks:
self.set_heartbeat_disabled()
self.set_power_save(0)
def set_can_forwarding(self, from_bus, to_bus):
# TODO: This feature may not work correctly with saturated buses