thermald: accept ignition from any panda (#23721)

* ignition from any panda

* more elegant )

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* typo

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 2629715097
commatwo_master
Igor Biletskyy 3 years ago committed by GitHub
parent ff3edba5fe
commit 64d3fa7e64
  1. 7
      selfdrive/thermald/thermald.py

@ -251,10 +251,11 @@ def thermald_thread(end_event, hw_queue):
msg = read_thermal(thermal_config) msg = read_thermal(thermal_config)
if sm.updated['pandaStates'] and len(pandaStates) > 0: if sm.updated['pandaStates'] and len(pandaStates) > 0:
pandaState = pandaStates[0]
if pandaState.pandaType != log.PandaState.PandaType.unknown: # Set ignition based on any panda connected
onroad_conditions["ignition"] = pandaState.ignitionLine or pandaState.ignitionCan onroad_conditions["ignition"] = any(ps.ignitionLine or ps.ignitionCan for ps in pandaStates if ps.pandaType != log.PandaState.PandaType.unknown)
pandaState = pandaStates[0]
in_car = pandaState.harnessStatus != log.PandaState.HarnessStatus.notConnected in_car = pandaState.harnessStatus != log.PandaState.HarnessStatus.notConnected
usb_power = peripheralState.usbPowerMode != log.PeripheralState.UsbPowerMode.client usb_power = peripheralState.usbPowerMode != log.PeripheralState.UsbPowerMode.client

Loading…
Cancel
Save