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>
pull/23723/head
Igor Biletskyy 3 years ago committed by GitHub
parent 12b48dcfb0
commit 2629715097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      selfdrive/thermald/thermald.py

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

Loading…
Cancel
Save