mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-25 07:52:03 +08:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user